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
This commit is contained in:
Andy McCrae 2016-12-21 15:24:14 +00:00 committed by Andy McCrae
parent 4318ef6c5a
commit 75d2b971d7
4 changed files with 25 additions and 24 deletions

View File

@ -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 }}"

View File

@ -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``.

View File

@ -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:

View File

@ -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"