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
102 lines
3.2 KiB
YAML
102 lines
3.2 KiB
YAML
---
|
|
# 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: Add galera apt-keys
|
|
block:
|
|
- name: Add keys (primary keyserver)
|
|
apt_key:
|
|
id: "{{ item.hash_id }}"
|
|
keyserver: "{{ item.keyserver | default(omit) }}"
|
|
data: "{{ item.data | default(omit) }}"
|
|
url: "{{ item.url | default(omit) }}"
|
|
state: "present"
|
|
register: add_keys
|
|
until: add_keys | success
|
|
retries: 5
|
|
delay: 2
|
|
with_items: "{{ galera_gpg_keys }}"
|
|
rescue:
|
|
- name: Add keys (fallback keyserver)
|
|
apt_key:
|
|
id: "{{ item.hash_id }}"
|
|
keyserver: "{{ item.fallback_keyserver | default(omit) }}"
|
|
url: "{{ item.fallback_url | default(omit) }}"
|
|
state: "present"
|
|
register: add_keys_fallback
|
|
until: add_keys_fallback | success
|
|
retries: 5
|
|
delay: 2
|
|
with_items: "{{ galera_gpg_keys }}"
|
|
when:
|
|
- item.fallback_keyserver is defined or item.fallback_url is defined
|
|
|
|
- name: Remove old repos
|
|
lineinfile:
|
|
dest: "/etc/apt/sources.list.d/{{ item.name }}.list"
|
|
regexp: "^((?!{{ item.repo }}).*)$"
|
|
state: absent
|
|
with_items:
|
|
- { name: "MariaDB", repo: "{{ galera_repo.repo }}" }
|
|
- { name: "Percona", repo: "{{ galera_percona_xtrabackup_repo.repo }}" }
|
|
|
|
- name: Add galera repo
|
|
apt_repository:
|
|
repo: "{{ galera_repo.repo }}"
|
|
filename: "{{ galera_repo.filename | default(omit) }}"
|
|
state: "{{ galera_repo.state }}"
|
|
update_cache: "no"
|
|
register: add_galera_repo
|
|
|
|
- name: Add percona repo
|
|
apt_repository:
|
|
repo: "{{ galera_percona_xtrabackup_repo.repo }}"
|
|
filename: "{{ galera_percona_xtrabackup_repo.filename | default(omit) }}"
|
|
state: "{{ galera_percona_xtrabackup_repo.state }}"
|
|
update_cache: "no"
|
|
register: add_percona_repo
|
|
|
|
- name: Preseed galera password(s)
|
|
debconf:
|
|
name: "{{ item.name }}"
|
|
question: "{{ item.question }}"
|
|
value: "{{ item.value }}"
|
|
vtype: "{{ item.vtype }}"
|
|
with_items: "{{ galera_debconf_items }}"
|
|
|
|
- name: Prevent galera from starting on install
|
|
copy:
|
|
src: "policy-rc.d"
|
|
dest: "/usr/sbin/policy-rc.d"
|
|
mode: "0755"
|
|
backup: yes
|
|
changed_when: false
|
|
|
|
- name: Install galera_server role remote packages (apt)
|
|
apt:
|
|
name: "{{ galera_packages_list }}"
|
|
state: "{{ galera_server_package_state }}"
|
|
update_cache: yes
|
|
cache_valid_time: "{{ (add_galera_repo | changed or add_percona_repo | changed) | ternary('0', cache_timeout) }}"
|
|
register: install_remote_apt_packages
|
|
until: install_remote_apt_packages|success
|
|
retries: 5
|
|
delay: 2
|
|
|
|
- name: Remove policy-rc now that the package install is complete
|
|
file:
|
|
path: "/usr/sbin/policy-rc.d"
|
|
state: absent
|
|
changed_when: false
|