Restore support for percona packages when using ppc64le

In https://review.openstack.org/535252 the installation
process for the role was simplified, but an unintentional
side-effect was to removed the previously included support
for installing the extra percona packages when installing
on the ppc64le platform.

This patch re-introduces that ability, but scopes it to
only execute on that hardware platform, and only for Ubuntu.

The download is, by default, facilitated through the deploy
node (rather than the target nodes) so that the download
is done once, then pushed to the targets. This can be
adjusted with the right parameters to download from the
targets instead.

Also, in https://review.openstack.org/543888 adjustments
were made to disable compression/qpress on architectures
other than x86_64, and to fail the role execution if it
was enabled on any other architecture. This has been
corrected to ensure that compression is enabled by default
for ppc64le on Ubuntu, and enabled by default for x86_64,
but disabled by default for all other combinations. The
fail task is adjusted appropriately and moved to the main
task file so that it executes and fails out before any
changes are made.

Change-Id: I850a37b465a427a827e357111942973457fafa0d
(cherry picked from commit 1075fe411a)
This commit is contained in:
Jesse Pretorius 2018-02-22 18:30:40 +00:00
parent 93d27774a0
commit 7c1749d97b
8 changed files with 127 additions and 14 deletions

View File

@ -113,8 +113,8 @@ galera_wsrep_provider_options:
galera_wsrep_sst_auth_user: "root" galera_wsrep_sst_auth_user: "root"
galera_wsrep_sst_auth_password: "{{ galera_root_password }}" galera_wsrep_sst_auth_password: "{{ galera_root_password }}"
# Enable compression of backups. Qpress is only availabe for x86_64 # Enable compression of backups.
galera_xtrabackup_compression: "{{ (ansible_architecture == 'x86_64') | ternary(true, false) }}" galera_xtrabackup_compression: "{{ (ansible_architecture == 'x86_64') or (ansible_architecture == 'ppc64le' and ansible_distribution == 'Ubuntu') }}"
# xtrabackup parallel/compression/sync threads # xtrabackup parallel/compression/sync threads
galera_xtrabackup_threads: 4 galera_xtrabackup_threads: 4
@ -193,3 +193,13 @@ galera_disable_privatedevices: "{{ _galera_disable_privatedevices }}"
## Set default mirror for openSUSE repositories ## Set default mirror for openSUSE repositories
# NOTE(hwoarang): Ensure that the full path to the 'opensuse' directory is used. # NOTE(hwoarang): Ensure that the full path to the 'opensuse' directory is used.
#galera_server_opensuse_mirror_obs_url: "http://widehat.opensuse.org" #galera_server_opensuse_mirror_obs_url: "http://widehat.opensuse.org"
# Where the extra package download is executed from.
# Options are ['deployment-host', 'target-host']
galera_server_extra_package_downloader: "deployment-host"
# The location where the extra packages are downloaded to
galera_server_extra_package_path: "/opt/cache/files"
# Toggle whether certificate validation should be enabled/disabled
galera_server_extra_package_validate_certs: yes

View File

@ -0,0 +1,31 @@
---
features:
- |
The extra packages percona packages used by the ppc64le
are now downloaded by the Ansible deployment host by
default, as opposed to the target hosts. Once downloaded
the packages are pushed up to the target hosts.
This behaviour may be adjusted by setting
``galera_server_extra_package_downloader`` to
``target-host``.
The packages are downloaded to the path set in
``galera_server_extra_package_path``.
deprecations:
- |
The following variables have been removed as they no
longer serve any purpose.
* ``galera_package_arch``
* ``percona_package_download_validate_certs``
* ``percona_package_url``
* ``percona_package_fallback_url``
* ``percona_package_sha256``
* ``percona_package_path``
* ``qpress_package_download_validate_certs``
* ``qpress_package_url``
* ``qpress_package_fallback_url``
* ``qpress_package_sha256``
* ``qpress_package_path``
The functionality previously using these variables has
been transitioned to using a simpler data structure.

View File

@ -13,22 +13,31 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- name: Add percona packages to the galera packages list - name: Prepare the package list
set_fact: set_fact:
galera_packages_list: "{{ galera_server_required_distro_packages + galera_server_mariadb_distro_packages + galera_server_percona_distro_packages }}" galera_packages_list: |-
{% set packages = galera_server_required_distro_packages + galera_server_mariadb_distro_packages %}
{% if ansible_architecture == 'x86_64' %}
{% set _ = packages.extend(galera_server_percona_distro_packages) %}
{% endif %}
{% if ansible_architecture == 'ppc64le' and ansible_distribution == 'Ubuntu' %}
{% for extra_package in galera_server_percona_distro_packages_alt_arch['ansible_architecture'] %}
{% set _package_path = galera_server_extra_package_path ~ '/' ~ ansible_architecture %}
{% set _ = packages.append(_package_path ~ '/' ~ extra_package['url'] | basename) %}
{% endfor %}
{% endif %}
{{ packages }}
- name: Download the extra packages
include_tasks: galera_install_download_extra_packages.yml
when:
- ansible_architecture == 'ppc64le'
- name: Remove conflicting distro packages - name: Remove conflicting distro packages
package: package:
name: "{{ galera_server_mariadb_distro_packages_remove | default([]) }}" name: "{{ galera_server_mariadb_distro_packages_remove | default([]) }}"
state: absent state: absent
- name: Fail if compression is enabled on unsupported architecture
fail:
msg: "qpress compression is only available on x86_64 architectures"
when:
- galera_xtrabackup_compression | bool
- ansible_architecture != 'x86_64'
- include_tasks: "galera_install_{{ ansible_pkg_mgr }}.yml" - include_tasks: "galera_install_{{ ansible_pkg_mgr }}.yml"
- name: Install pip packages - name: Install pip packages

View File

@ -94,7 +94,7 @@
retries: 5 retries: 5
delay: 2 delay: 2
- name: Remove policy-rc - name: Remove policy-rc now that the package install is complete
file: file:
path: "/usr/sbin/policy-rc.d" path: "/usr/sbin/policy-rc.d"
state: absent state: absent

View File

@ -0,0 +1,47 @@
---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Ensure that galera_server_extra_package_paths exist
file:
path: "{{ galera_server_extra_package_path }}/{{ item.key }}"
state: directory
with_dict: "{{ galera_server_percona_distro_packages_alt_arch }}"
delegate_to: "{{ (galera_server_extra_package_downloader == 'deployment-host') | ternary('localhost', omit) }}"
- name: Download extra packages
get_url:
url: "{{ item.value.url }}"
dest: "{{ galera_server_extra_package_path }}/{{ item.key }}/"
checksum: "{{ item.value.checksum | default(omit) }}"
force: "{{ item.value.checksum is not defined }}"
validate_certs: "{{ galera_server_extra_package_validate_certs }}"
with_dict: "{{ galera_server_percona_distro_packages_alt_arch }}"
register: fetch_url
until: fetch_url | success
retries: 3
delay: 10
delegate_to: "{{ (galera_server_extra_package_downloader == 'deployment-host') | ternary('localhost', omit) }}"
- name: Copy downloaded packages from deployment-host to target-host
copy:
src: "{{ galera_server_extra_package_path }}/{{ item.key }}/{{ item.value.url | basename }}"
dest: "{{ galera_server_extra_package_path }}/{{ item.key }}/"
with_dict: "{{ galera_server_percona_distro_packages_alt_arch }}"
when:
- galera_server_extra_package_downloader == "deployment-host"
register: file_copy
until: file_copy | success
retries: 5
delay: 10

View File

@ -29,6 +29,15 @@
tags: tags:
- always - always
- name: Fail if compression is enabled on unsupported architecture/distro
fail:
msg: |
qpress compression is only supported for x86_64 and for Ubuntu/ppc64le
when:
- galera_xtrabackup_compression | bool
- (ansible_architecture != 'x86_64') and
not (ansible_architecture == 'ppc64le' and ansible_distribution == 'Ubuntu')
- name: Gather variables for each operating system - name: Gather variables for each operating system
include_vars: "{{ item }}" include_vars: "{{ item }}"
with_first_found: with_first_found:

View File

@ -82,4 +82,4 @@ galera_server_percona_distro_packages:
galera_wsrep_provider: "/usr/lib/galera/libgalera_smm.so" galera_wsrep_provider: "/usr/lib/galera/libgalera_smm.so"
_use_percona_upstream: yes _use_percona_upstream: "{{ ansible_architecture == 'x86_64' }}"

View File

@ -101,4 +101,11 @@ _galera_repo:
galera_wsrep_provider: "/usr/lib/galera/libgalera_smm.so" galera_wsrep_provider: "/usr/lib/galera/libgalera_smm.so"
_use_percona_upstream: yes _use_percona_upstream: "{{ ansible_architecture == 'x86_64' }}"
galera_server_percona_distro_packages_alt_arch:
ppc64le:
- url: "http://public.dhe.ibm.com/systems/virtualization/Novalink/misc/percona-xtrabackup/percona-xtrabackup-24_2.4.5-1_ppc64el.deb"
checksum: "sha256:3d4e4112f4c8020c9190a91d962dabed1dfaad307160a939e121208887eaee2a"
- url: "http://public.dhe.ibm.com/systems/virtualization/Novalink/misc/qpress/qpress_11-1_ppc64el.deb"
checksum: "sha256:a31d3e00dbcec9b3f98eae82b261d054d0b80a57f4a38967d0e953811cb082f3"