diff --git a/playbooks/roles/galera_client/defaults/main.yml b/playbooks/roles/galera_client/defaults/main.yml index 896b7e35ca..20f1d007ae 100644 --- a/playbooks/roles/galera_client/defaults/main.yml +++ b/playbooks/roles/galera_client/defaults/main.yml @@ -25,8 +25,10 @@ galera_client_gpg_keys: hash_id: '0xcbcb082a1bb943db' # Repositories -galera_client_apt_repos: - - { repo: "deb http://mirror.rackspace.com/mariadb/repo/5.5/ubuntu {{ ansible_distribution_release }} main", state: "present" } +galera_client_apt_repo_url: "http://mirror.rackspace.com/mariadb/repo/5.5/ubuntu" +galera_client_apt_repo: + repo: "deb {{ galera_client_apt_repo_url }} {{ ansible_distribution_release }} main" + state: "present" galera_client_apt_packages: - libmariadbclient-dev diff --git a/playbooks/roles/galera_client/tasks/galera_client_pre_install.yml b/playbooks/roles/galera_client/tasks/galera_client_pre_install.yml index 5a488ac0a4..aa9b76619e 100644 --- a/playbooks/roles/galera_client/tasks/galera_client_pre_install.yml +++ b/playbooks/roles/galera_client/tasks/galera_client_pre_install.yml @@ -40,11 +40,20 @@ tags: - galera-client-apt-keys +- name: Drop galera repo pin + template: + src: "galera_client_pin.pref.j2" + dest: "/etc/apt/preferences.d/galera_client_pin.pref" + owner: "root" + group: "root" + mode: "0644" + tags: + - galera-client-repo-pin + - name: Add galera repo(s) apt_repository: - repo: "{{ item.repo }}" - state: "{{ item.state }}" - with_items: galera_client_apt_repos + repo: "{{ galera_client_apt_repo.repo }}" + state: "{{ galera_client_apt_repo.state }}" register: add_repos until: add_repos|success retries: 5 diff --git a/playbooks/roles/galera_client/templates/galera_client_pin.pref.j2 b/playbooks/roles/galera_client/templates/galera_client_pin.pref.j2 new file mode 100644 index 0000000000..0d2a6e5c22 --- /dev/null +++ b/playbooks/roles/galera_client/templates/galera_client_pin.pref.j2 @@ -0,0 +1,5 @@ +# {{ ansible_managed }} + +Package: * +Pin: release o=MariaDB +Pin-Priority: 1001 diff --git a/playbooks/roles/galera_server/defaults/main.yml b/playbooks/roles/galera_server/defaults/main.yml index 6dfe4a97e1..924f49e0af 100644 --- a/playbooks/roles/galera_server/defaults/main.yml +++ b/playbooks/roles/galera_server/defaults/main.yml @@ -52,8 +52,10 @@ galera_gpg_keys: hash_id: '0xcbcb082a1bb943db' # Repositories -galera_apt_repos: - - { repo: "deb http://mirror.rackspace.com/mariadb/repo/5.5/ubuntu {{ ansible_distribution_release }} main", state: "present" } +galera_apt_repo_url: "http://mirror.rackspace.com/mariadb/repo/5.5/ubuntu" +galera_apt_repo: + repo: "deb {{ galera_apt_repo_url }} {{ ansible_distribution_release }} main" + state: "present" galera_pip_packages: - MySQL-python diff --git a/playbooks/roles/galera_server/tasks/galera_pre_install.yml b/playbooks/roles/galera_server/tasks/galera_pre_install.yml index d7267e8e11..2d816d90d2 100644 --- a/playbooks/roles/galera_server/tasks/galera_pre_install.yml +++ b/playbooks/roles/galera_server/tasks/galera_pre_install.yml @@ -55,11 +55,20 @@ tags: - galera-apt-keys +- name: Drop galera repo pin + template: + src: "galera_pin.pref.j2" + dest: "/etc/apt/preferences.d/galera_pin.pref" + owner: "root" + group: "root" + mode: "0644" + tags: + - galera-repo-pin + - name: Add galera repo(s) apt_repository: - repo: "{{ item.repo }}" - state: "{{ item.state }}" - with_items: galera_apt_repos + repo: "{{ galera_apt_repo.repo }}" + state: "{{ galera_apt_repo.state }}" register: add_repos until: add_repos|success retries: 5 diff --git a/playbooks/roles/galera_server/templates/galera_pin.pref.j2 b/playbooks/roles/galera_server/templates/galera_pin.pref.j2 new file mode 100644 index 0000000000..0d2a6e5c22 --- /dev/null +++ b/playbooks/roles/galera_server/templates/galera_pin.pref.j2 @@ -0,0 +1,5 @@ +# {{ ansible_managed }} + +Package: * +Pin: release o=MariaDB +Pin-Priority: 1001 diff --git a/scripts/bootstrap-aio.sh b/scripts/bootstrap-aio.sh index 18ddcb7f74..073c23a081 100755 --- a/scripts/bootstrap-aio.sh +++ b/scripts/bootstrap-aio.sh @@ -86,8 +86,13 @@ if [ ! "$(grep -e '^nameserver 8.8.8.8' -e '^nameserver 8.8.4.4' /etc/resolv.con echo -e '\n# Adding google name servers\nnameserver 8.8.8.8\nnameserver 8.8.4.4' | tee -a /etc/resolv.conf fi -# Update the package cache and install required packages +# Update the package cache apt-get update + +# Remove known conflicting packages in the base image +apt-get purge -y libmysqlclient18 mysql-common + +# Install required packages apt-get install -y python-dev \ python2.7 \ build-essential \