From 75d2b971d74815f3da60d1109e93f3106bb4e96d Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Wed, 21 Dec 2016 15:24:14 +0000 Subject: [PATCH] Use local facts for ansible_architecture This patch ensure the local host's ansible facts are used for the "ansible_architecture" fact, rather than the "physical_host". Since we don't explicitly collect facts for "physical_host", and the ansible_architecture fact is set for the local host container, we don't need to try to retrieve the "physical_host" facts. A new var "galera_package_arch" is created so that the architecture can be overriden if it isn't being calculated correctly. Additionally, the duplicate vars that are not specific to distributions have been moved into defaults, and out of the specific distribution vars files. Change-Id: I5124c061faf124388a88eefee93d96e9a9e90d8f Closes-Bug: 1650384 --- defaults/main.yml | 16 ++++++++++++++++ .../galera_package_arch-913fb39b07a139fd.yaml | 9 +++++++++ vars/redhat-7.yml | 12 ------------ vars/ubuntu-16.04.yml | 12 ------------ 4 files changed, 25 insertions(+), 24 deletions(-) create mode 100644 releasenotes/notes/galera_package_arch-913fb39b07a139fd.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 2035ca1d..62edd3c5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -103,3 +103,19 @@ galera_debian_cnf_overrides: {} # the cluster will be used which is something to note if deploying galera on different # hardware. # galera_max_connections: 500 + +# Settings for percona and qpress +# The [percona|qpress]_arch_[url|sha256] hashes can be found in the distro vars files. +galera_package_arch: "{{ hostvars[inventory_hostname]['ansible_architecture'] }}" + +# Validate SSL certificates when downloading the galera deb above +# May be set to "no" when proxy server is intercepting the certificates. +percona_package_download_validate_certs: yes +percona_package_url: "{{ percona_arch_url.get( galera_package_arch | lower ) }}" +percona_package_sha256: "{{ percona_arch_sha256.get( galera_package_arch | lower ) }}" +percona_package_path: "/opt/{{ percona_package_url | basename }}" + +qpress_package_download_validate_certs: yes +qpress_package_url: "{{ qpress_arch_url.get( galera_package_arch | lower ) }}" +qpress_package_sha256: "{{ qpress_arch_sha256.get( galera_package_arch | lower ) }}" +qpress_package_path: "/opt/{{ qpress_package_url | basename }}" diff --git a/releasenotes/notes/galera_package_arch-913fb39b07a139fd.yaml b/releasenotes/notes/galera_package_arch-913fb39b07a139fd.yaml new file mode 100644 index 00000000..13c3aa48 --- /dev/null +++ b/releasenotes/notes/galera_package_arch-913fb39b07a139fd.yaml @@ -0,0 +1,9 @@ +--- +features: + - You can specify the ``galera_package_arch`` variable + to force a specific architecture when installing + percona and qpress packages. This will be automatically + calculated based on the architecture of the + ``galera_server`` host. Acceptable values are ``x86_64`` + for ``Ubuntu-16.04`` and ``RHEL 7``, and ``ppc64le`` for + ``Ubuntu-16.04``. diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index 03a18c8f..5eb3e8a0 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -54,23 +54,11 @@ galera_server_percona_distro_packages: - qpress - percona-xtrabackup -# Validate SSL certificates when downloading the galera packages above -# May be set to "no" when proxy server is intercepting the certificates. -percona_package_download_validate_certs: "yes" -percona_package_url: "{{ percona_arch_url.get( hostvars[physical_host | default(inventory_hostname)]['ansible_architecture'] | lower ) }}" -percona_package_sha256: "{{ percona_arch_sha256.get( hostvars[physical_host | default(inventory_hostname)]['ansible_architecture'] | lower ) }}" -percona_package_path: "/opt/{{ percona_package_url | basename }}" - percona_arch_url: x86_64: "https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.2.13/binary/redhat/7/x86_64/percona-xtrabackup-22-2.2.13-1.el7.x86_64.rpm" percona_arch_sha256: x86_64: "030585abb52b24a781641374fe7c4530518b176a10ed4eb75547803b6b1f60e4" -qpress_package_download_validate_certs: yes -qpress_package_url: "{{ qpress_arch_url.get( hostvars[physical_host | default(inventory_hostname)]['ansible_architecture'] | lower ) }}" -qpress_package_sha256: "{{ qpress_arch_sha256.get( hostvars[physical_host | default(inventory_hostname)]['ansible_architecture'] | lower ) }}" -qpress_package_path: "/opt/{{ qpress_package_url | basename }}" - qpress_arch_url: x86_64: "https://repo.percona.com/centos/7/RPMS/x86_64/qpress-11-1.el7.x86_64.rpm" qpress_arch_sha256: diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index 3a71ad5d..18e22154 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -72,13 +72,6 @@ galera_server_percona_distro_packages: - qpress - percona-xtrabackup -# Validate SSL certificates when downloading the galera deb above -# May be set to "no" when proxy server is intercepting the certificates. -percona_package_download_validate_certs: yes -percona_package_url: "{{ percona_arch_url.get( hostvars[physical_host | default(inventory_hostname)]['ansible_architecture'] | lower ) }}" -percona_package_sha256: "{{ percona_arch_sha256.get( hostvars[physical_host | default(inventory_hostname)]['ansible_architecture'] | lower ) }}" -percona_package_path: "/opt/{{ percona_package_url | basename }}" - percona_arch_url: x86_64: "https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.2.13/binary/debian/vivid/x86_64/percona-xtrabackup-22_2.2.13-1.vivid_amd64.deb" ppc64le: "http://public.dhe.ibm.com/systems/virtualization/Novalink/misc/percona-xtrabackup/percona-xtrabackup-22_2.2.13-1_ppc64el.deb" @@ -86,11 +79,6 @@ percona_arch_sha256: x86_64: "3e3b15b2b261da004f7c4419ae427af9ec5707b40be1effe22a0142311c51856" ppc64le: "902969b427a36743f5af1e399ff19b3904c3803d760700f959c8cc9102ab802c" -qpress_package_download_validate_certs: yes -qpress_package_url: "{{ qpress_arch_url.get( hostvars[physical_host | default(inventory_hostname)]['ansible_architecture'] | lower ) }}" -qpress_package_sha256: "{{ qpress_arch_sha256.get( hostvars[physical_host | default(inventory_hostname)]['ansible_architecture'] | lower ) }}" -qpress_package_path: "/opt/{{ qpress_package_url | basename }}" - qpress_arch_url: x86_64: "https://repo.percona.com/apt/pool/main/q/qpress/qpress_11-1.xenial_amd64.deb" ppc64le: "http://public.dhe.ibm.com/systems/virtualization/Novalink/misc/qpress/qpress_11-1_ppc64el.deb"