Remove references to unsupported operating systems
All references to Gentoo, SUSE, Debian stretch and Centos-7 are removed. Conditional tasks, ternary operators and variables are simplified where possible OS specific variables files are generalised where possible Change-Id: I50bb0f00658e292f39269c3980109e56319a00ca
This commit is contained in:
parent
27e938b38b
commit
49b7d9488b
@ -22,17 +22,14 @@ galaxy_info:
|
|||||||
platforms:
|
platforms:
|
||||||
- name: Debian
|
- name: Debian
|
||||||
versions:
|
versions:
|
||||||
- stretch
|
- buster
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
- xenial
|
|
||||||
- bionic
|
- bionic
|
||||||
|
- focal
|
||||||
- name: EL
|
- name: EL
|
||||||
versions:
|
versions:
|
||||||
- 7
|
- 8
|
||||||
- name: opensuse
|
|
||||||
versions:
|
|
||||||
- 15
|
|
||||||
categories:
|
categories:
|
||||||
- cloud
|
- cloud
|
||||||
- galera
|
- galera
|
||||||
|
@ -1 +0,0 @@
|
|||||||
galera_install_yum.yml
|
|
150
tasks/galera_install_dnf.yml
Normal file
150
tasks/galera_install_dnf.yml
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
---
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# Unfortunately yum is case-insensitive, and RDO has mariadb-* packages,
|
||||||
|
# while the MariaDB repo has MariaDB-* packages and they conflict.
|
||||||
|
# To work around this we have to query for any installed RDO/CentOS
|
||||||
|
# packages using rpm, then remove them. We have to remove them without
|
||||||
|
# dependencies, otherwise for distro package installation types on shared
|
||||||
|
# hosts it removes far too many packages.
|
||||||
|
- name: Remove conflicting packages
|
||||||
|
shell: |
|
||||||
|
exit_code=0
|
||||||
|
for pkg in {{ galera_mariadb_distro_packages_remove | join(' ') }}; do
|
||||||
|
if rpm --query --quiet ${pkg}; then
|
||||||
|
rpm -ev --nodeps ${pkg}
|
||||||
|
exit_code=2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
exit ${exit_code}
|
||||||
|
register: _remove_existing_mariadb_packages
|
||||||
|
changed_when: _remove_existing_mariadb_packages.rc == 2
|
||||||
|
failed_when: _remove_existing_mariadb_packages.rc not in [0, 2]
|
||||||
|
args:
|
||||||
|
warn: no
|
||||||
|
executable: /bin/bash
|
||||||
|
|
||||||
|
# In CentOS systems, /etc/my.cnf.d may already exist on the
|
||||||
|
# system. We need to ensure that it is removed if that is true so
|
||||||
|
# that we can replace it with symlinks to the directories expected
|
||||||
|
# to be used by the MariaDB packages instead.
|
||||||
|
- name: Stat /etc/my.cnf.d
|
||||||
|
stat:
|
||||||
|
path: /etc/my.cnf.d
|
||||||
|
get_attributes: no
|
||||||
|
get_checksum: no
|
||||||
|
get_mime: no
|
||||||
|
register: mycnfd_stat
|
||||||
|
|
||||||
|
- name: Destroy my.cnf.d dir if is dir
|
||||||
|
file:
|
||||||
|
path: /etc/my.cnf.d
|
||||||
|
state: absent
|
||||||
|
force: true
|
||||||
|
when:
|
||||||
|
- mycnfd_stat.stat.isdir is defined
|
||||||
|
- mycnfd_stat.stat.isdir
|
||||||
|
|
||||||
|
# We replace the default paths for the system with symlinks to
|
||||||
|
# the paths used by the MariaDB packages so ensure that any other
|
||||||
|
# system expectations are still met.
|
||||||
|
- name: Update the local file system CRUD
|
||||||
|
file:
|
||||||
|
src: "{{ item.src | default(omit) }}"
|
||||||
|
path: "{{ item.path }}"
|
||||||
|
state: "{{ item.state }}"
|
||||||
|
force: "{{ item.force | default(omit) }}"
|
||||||
|
mode: "{{ item.mode | default(omit) }}"
|
||||||
|
with_items:
|
||||||
|
- path: "/etc/mysql"
|
||||||
|
state: "directory"
|
||||||
|
mode: '0755'
|
||||||
|
- path: "/etc/mysql/conf.d"
|
||||||
|
state: "directory"
|
||||||
|
- src: "/usr/lib64/galera"
|
||||||
|
path: "/usr/lib/galera"
|
||||||
|
state: "link"
|
||||||
|
force: true
|
||||||
|
- src: "/etc/mysql/conf.d"
|
||||||
|
path: "/etc/my.cnf.d"
|
||||||
|
state: "link"
|
||||||
|
force: true
|
||||||
|
- src: "/etc/mysql/my.cnf"
|
||||||
|
path: "/etc/my.cnf"
|
||||||
|
state: "link"
|
||||||
|
force: true
|
||||||
|
|
||||||
|
- name: If a keyfile is provided, copy the gpg keyfile to the key location
|
||||||
|
copy:
|
||||||
|
src: "gpg/{{ item.key | basename }}"
|
||||||
|
dest: "{{ item.key }}"
|
||||||
|
mode: '0644'
|
||||||
|
with_items: "{{ galera_gpg_keys }}"
|
||||||
|
|
||||||
|
- name: Install gpg keys
|
||||||
|
rpm_key: "{{ key }}"
|
||||||
|
with_items: "{{ galera_gpg_keys }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: key
|
||||||
|
register: _add_yum_keys
|
||||||
|
until: _add_yum_keys is success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
|
||||||
|
- name: Add galera repo
|
||||||
|
yum_repository:
|
||||||
|
name: "{{ galera_repo.name }}"
|
||||||
|
description: "{{ galera_repo.description }}"
|
||||||
|
baseurl: "{{ galera_repo.baseurl }}"
|
||||||
|
gpgkey: "{{ galera_repo.gpgkey | default(omit) }}"
|
||||||
|
gpgcheck: yes
|
||||||
|
enabled: yes
|
||||||
|
priority: 25
|
||||||
|
register: add_galera_repos
|
||||||
|
until: add_galera_repos is success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
|
||||||
|
- name: Enable module_hotfixes
|
||||||
|
lineinfile:
|
||||||
|
dest: "/etc/yum.repos.d/{{ galera_repo.name }}.repo"
|
||||||
|
line: "module_hotfixes=1"
|
||||||
|
regexp: "^module_hotfixes"
|
||||||
|
insertafter: "^enabled"
|
||||||
|
|
||||||
|
# When changing the repo URL, the metadata does
|
||||||
|
# not reliably update, resulting in the right
|
||||||
|
# URL being used, but the wrong package list.
|
||||||
|
# This is why we force the metadata to be
|
||||||
|
# cleaned out whenever the repo config changes.
|
||||||
|
- name: Force the expiry of the repo metadata
|
||||||
|
command: "{{ ansible_facts['pkg_mgr'] }} clean metadata"
|
||||||
|
args:
|
||||||
|
warn: no
|
||||||
|
when: add_galera_repos is changed
|
||||||
|
tags:
|
||||||
|
- skip_ansible_lint
|
||||||
|
|
||||||
|
- name: Install galera role remote packages
|
||||||
|
package:
|
||||||
|
name: "{{ galera_packages_list }}"
|
||||||
|
state: "{{ galera_package_state }}"
|
||||||
|
register: install_remote_packages
|
||||||
|
until: install_remote_packages is success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
notify:
|
||||||
|
- Manage LB
|
||||||
|
- Restart all mysql
|
@ -1,42 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2019, Matthew Thode
|
|
||||||
#
|
|
||||||
# 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: Install galera role packages
|
|
||||||
package:
|
|
||||||
name: "{{ galera_packages_list }}"
|
|
||||||
state: "{{ galera_package_state }}"
|
|
||||||
newuse: "{{ (ansible_facts['pkg_mgr'] == 'portage') | ternary('yes', omit) }}"
|
|
||||||
changed_use: "{{ (ansible_facts['pkg_mgr'] == 'portage') | ternary('yes', omit) }}"
|
|
||||||
noreplace: "{{ (ansible_facts['pkg_mgr'] == 'portage') | ternary('yes', omit) }}"
|
|
||||||
jobs: "{{ (ansible_facts['pkg_mgr'] == 'portage') | ternary('4', omit) }}"
|
|
||||||
register: install_remote_packages
|
|
||||||
until: install_remote_packages is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
notify:
|
|
||||||
- Manage LB
|
|
||||||
- Restart all mysql
|
|
||||||
|
|
||||||
- name: Ensure mysql config directories exists
|
|
||||||
file:
|
|
||||||
src: "{{ item.src | default(omit) }}"
|
|
||||||
path: "{{ item.path }}"
|
|
||||||
state: "{{ item.state }}"
|
|
||||||
force: "{{ item.force | default(omit) }}"
|
|
||||||
with_items:
|
|
||||||
- path: "/etc/mysql"
|
|
||||||
state: "directory"
|
|
||||||
- path: "{{ galera_etc_include_dir }}"
|
|
||||||
state: "directory"
|
|
@ -1,151 +0,0 @@
|
|||||||
---
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
# Unfortunately yum is case-insensitive, and RDO has mariadb-* packages,
|
|
||||||
# while the MariaDB repo has MariaDB-* packages and they conflict.
|
|
||||||
# To work around this we have to query for any installed RDO/CentOS
|
|
||||||
# packages using rpm, then remove them. We have to remove them without
|
|
||||||
# dependencies, otherwise for distro package installation types on shared
|
|
||||||
# hosts it removes far too many packages.
|
|
||||||
- name: Remove conflicting packages
|
|
||||||
shell: |
|
|
||||||
exit_code=0
|
|
||||||
for pkg in {{ galera_mariadb_distro_packages_remove | join(' ') }}; do
|
|
||||||
if rpm --query --quiet ${pkg}; then
|
|
||||||
rpm -ev --nodeps ${pkg}
|
|
||||||
exit_code=2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
exit ${exit_code}
|
|
||||||
register: _remove_existing_mariadb_packages
|
|
||||||
changed_when: _remove_existing_mariadb_packages.rc == 2
|
|
||||||
failed_when: _remove_existing_mariadb_packages.rc not in [0, 2]
|
|
||||||
args:
|
|
||||||
warn: no
|
|
||||||
executable: /bin/bash
|
|
||||||
|
|
||||||
# In SUSE/CentOS systems, /etc/my.cnf.d may already exist on the
|
|
||||||
# system. We need to ensure that it is removed if that is true so
|
|
||||||
# that we can replace it with symlinks to the directories expected
|
|
||||||
# to be used by the MariaDB packages instead.
|
|
||||||
- name: Stat /etc/my.cnf.d
|
|
||||||
stat:
|
|
||||||
path: /etc/my.cnf.d
|
|
||||||
get_attributes: no
|
|
||||||
get_checksum: no
|
|
||||||
get_mime: no
|
|
||||||
register: mycnfd_stat
|
|
||||||
|
|
||||||
- name: Destroy my.cnf.d dir if is dir
|
|
||||||
file:
|
|
||||||
path: /etc/my.cnf.d
|
|
||||||
state: absent
|
|
||||||
force: true
|
|
||||||
when:
|
|
||||||
- mycnfd_stat.stat.isdir is defined
|
|
||||||
- mycnfd_stat.stat.isdir
|
|
||||||
|
|
||||||
# We replace the default paths for the system with symlinks to
|
|
||||||
# the paths used by the MariaDB packages so ensure that any other
|
|
||||||
# system expectations are still met.
|
|
||||||
- name: Update the local file system CRUD
|
|
||||||
file:
|
|
||||||
src: "{{ item.src | default(omit) }}"
|
|
||||||
path: "{{ item.path }}"
|
|
||||||
state: "{{ item.state }}"
|
|
||||||
force: "{{ item.force | default(omit) }}"
|
|
||||||
mode: "{{ item.mode | default(omit) }}"
|
|
||||||
with_items:
|
|
||||||
- path: "/etc/mysql"
|
|
||||||
state: "directory"
|
|
||||||
mode: '0755'
|
|
||||||
- path: "/etc/mysql/conf.d"
|
|
||||||
state: "directory"
|
|
||||||
- src: "/usr/lib64/galera"
|
|
||||||
path: "/usr/lib/galera"
|
|
||||||
state: "link"
|
|
||||||
force: true
|
|
||||||
- src: "/etc/mysql/conf.d"
|
|
||||||
path: "/etc/my.cnf.d"
|
|
||||||
state: "link"
|
|
||||||
force: true
|
|
||||||
- src: "/etc/mysql/my.cnf"
|
|
||||||
path: "/etc/my.cnf"
|
|
||||||
state: "link"
|
|
||||||
force: true
|
|
||||||
|
|
||||||
- name: If a keyfile is provided, copy the gpg keyfile to the key location
|
|
||||||
copy:
|
|
||||||
src: "gpg/{{ item.key | basename }}"
|
|
||||||
dest: "{{ item.key }}"
|
|
||||||
mode: '0644'
|
|
||||||
with_items: "{{ galera_gpg_keys }}"
|
|
||||||
|
|
||||||
- name: Install gpg keys
|
|
||||||
rpm_key: "{{ key }}"
|
|
||||||
with_items: "{{ galera_gpg_keys }}"
|
|
||||||
loop_control:
|
|
||||||
loop_var: key
|
|
||||||
register: _add_yum_keys
|
|
||||||
until: _add_yum_keys is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
|
|
||||||
- name: Add galera repo
|
|
||||||
yum_repository:
|
|
||||||
name: "{{ galera_repo.name }}"
|
|
||||||
description: "{{ galera_repo.description }}"
|
|
||||||
baseurl: "{{ galera_repo.baseurl }}"
|
|
||||||
gpgkey: "{{ galera_repo.gpgkey | default(omit) }}"
|
|
||||||
gpgcheck: yes
|
|
||||||
enabled: yes
|
|
||||||
priority: 25
|
|
||||||
register: add_galera_repos
|
|
||||||
until: add_galera_repos is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
|
|
||||||
- name: Enable module_hotfixes
|
|
||||||
lineinfile:
|
|
||||||
dest: "/etc/yum.repos.d/{{ galera_repo.name }}.repo"
|
|
||||||
line: "module_hotfixes=1"
|
|
||||||
regexp: "^module_hotfixes"
|
|
||||||
insertafter: "^enabled"
|
|
||||||
when: ansible_facts['distribution_major_version'] is version('8', '>=')
|
|
||||||
|
|
||||||
# When changing the repo URL, the metadata does
|
|
||||||
# not reliably update, resulting in the right
|
|
||||||
# URL being used, but the wrong package list.
|
|
||||||
# This is why we force the metadata to be
|
|
||||||
# cleaned out whenever the repo config changes.
|
|
||||||
- name: Force the expiry of the repo metadata
|
|
||||||
command: "{{ ansible_facts['pkg_mgr'] }} clean metadata"
|
|
||||||
args:
|
|
||||||
warn: no
|
|
||||||
when: add_galera_repos is changed
|
|
||||||
tags:
|
|
||||||
- skip_ansible_lint
|
|
||||||
|
|
||||||
- name: Install galera role remote packages
|
|
||||||
package:
|
|
||||||
name: "{{ galera_packages_list }}"
|
|
||||||
state: "{{ galera_package_state }}"
|
|
||||||
register: install_remote_packages
|
|
||||||
until: install_remote_packages is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
notify:
|
|
||||||
- Manage LB
|
|
||||||
- Restart all mysql
|
|
@ -1,97 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2017, SUSE LINUX GmbH.
|
|
||||||
#
|
|
||||||
# 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: Remove conflicting distro packages
|
|
||||||
package:
|
|
||||||
name: "{{ galera_mariadb_distro_packages_remove }}"
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
# In SUSE/CentOS systems, /etc/my.cnf.d may already exist on the
|
|
||||||
# system. We need to ensure that it is removed if that is true so
|
|
||||||
# that we can replace it with symlinks to the directories expected
|
|
||||||
# to be used by the MariaDB packages instead.
|
|
||||||
- name: Stat /etc/my.cnf.d
|
|
||||||
stat:
|
|
||||||
path: /etc/my.cnf.d
|
|
||||||
get_attributes: no
|
|
||||||
get_checksum: no
|
|
||||||
get_mime: no
|
|
||||||
register: mycnfd_stat
|
|
||||||
|
|
||||||
- name: Destroy my.cnf.d dir if is dir
|
|
||||||
file:
|
|
||||||
path: /etc/my.cnf.d
|
|
||||||
state: absent
|
|
||||||
force: true
|
|
||||||
when:
|
|
||||||
- mycnfd_stat.stat.isdir is defined
|
|
||||||
- mycnfd_stat.stat.isdir
|
|
||||||
|
|
||||||
# We replace the default paths for the system with symlinks to
|
|
||||||
# the paths used by the MariaDB packages so ensure that any other
|
|
||||||
# system expectations are still met.
|
|
||||||
- name: Update the local file system CRUD
|
|
||||||
file:
|
|
||||||
src: "{{ item.src|default(omit) }}"
|
|
||||||
path: "{{ item.path }}"
|
|
||||||
state: "{{ item.state }}"
|
|
||||||
force: "{{ item.force|default(omit) }}"
|
|
||||||
with_items:
|
|
||||||
- { path: "/etc/mysql", state: "directory" }
|
|
||||||
- { path: "/etc/mysql/conf.d", state: "directory" }
|
|
||||||
- { src: "/etc/mysql/conf.d", path: "/etc/my.cnf.d", state: "link", force: true }
|
|
||||||
- { src: "/etc/mysql/my.cnf", path: "/etc/my.cnf", state: "link", force: true }
|
|
||||||
|
|
||||||
- name: If a keyfile is provided, copy the gpg keyfile to the key location
|
|
||||||
copy:
|
|
||||||
src: "gpg/{{ item.key | basename }}"
|
|
||||||
dest: "{{ item.key }}"
|
|
||||||
mode: '0644'
|
|
||||||
with_items: "{{ galera_gpg_keys }}"
|
|
||||||
|
|
||||||
- name: Install gpg keys
|
|
||||||
rpm_key: "{{ key }}"
|
|
||||||
with_items: "{{ galera_gpg_keys }}"
|
|
||||||
loop_control:
|
|
||||||
loop_var: key
|
|
||||||
register: _add_zypper_keys
|
|
||||||
until: _add_zypper_keys is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
|
|
||||||
- name: Add galera repo
|
|
||||||
zypper_repository:
|
|
||||||
name: "{{ galera_repo.name }}"
|
|
||||||
description: "{{ galera_repo.description }}"
|
|
||||||
repo: "{{ galera_repo.baseurl }}"
|
|
||||||
autorefresh: yes
|
|
||||||
auto_import_keys: no
|
|
||||||
enabled: yes
|
|
||||||
register: add_repos
|
|
||||||
until: add_repos is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
|
|
||||||
- name: Install galera_server role remote packages (zypper)
|
|
||||||
zypper:
|
|
||||||
name: "{{ galera_packages_list }}"
|
|
||||||
state: "{{ galera_package_state }}"
|
|
||||||
register: install_remote_packages
|
|
||||||
until: install_remote_packages is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
notify:
|
|
||||||
- Manage LB
|
|
||||||
- Restart all mysql
|
|
@ -46,7 +46,6 @@
|
|||||||
# as all of these tasks will be run on Package install
|
# as all of these tasks will be run on Package install
|
||||||
# and running them again will cause a conflict within
|
# and running them again will cause a conflict within
|
||||||
# debian based deployments.
|
# debian based deployments.
|
||||||
# NOTE(prometheanfire): Ditto Gentoo ^
|
|
||||||
- name: Create galera initial secure tool
|
- name: Create galera initial secure tool
|
||||||
template:
|
template:
|
||||||
src: "galera_secure_node.j2"
|
src: "galera_secure_node.j2"
|
||||||
@ -54,7 +53,6 @@
|
|||||||
mode: "0750"
|
mode: "0750"
|
||||||
when:
|
when:
|
||||||
- ansible_facts['pkg_mgr'] != "apt"
|
- ansible_facts['pkg_mgr'] != "apt"
|
||||||
- ansible_facts['pkg_mgr'] != "portage"
|
|
||||||
- not galera_upgrade
|
- not galera_upgrade
|
||||||
|
|
||||||
- name: Run galera secure
|
- name: Run galera secure
|
||||||
@ -64,7 +62,6 @@
|
|||||||
warn: no
|
warn: no
|
||||||
when:
|
when:
|
||||||
- ansible_facts['pkg_mgr'] != "apt"
|
- ansible_facts['pkg_mgr'] != "apt"
|
||||||
- ansible_facts['pkg_mgr'] != "portage"
|
|
||||||
- not galera_upgrade
|
- not galera_upgrade
|
||||||
tags:
|
tags:
|
||||||
- skip_ansible_lint
|
- skip_ansible_lint
|
||||||
@ -129,20 +126,11 @@
|
|||||||
- Manage LB
|
- Manage LB
|
||||||
- Restart all mysql
|
- Restart all mysql
|
||||||
|
|
||||||
# Safe to run multiple times, config has it's own checks
|
|
||||||
- name: initialize database (gentoo)
|
|
||||||
command: "emerge --config dev-db/mariadb"
|
|
||||||
failed_when: false
|
|
||||||
when:
|
|
||||||
- ansible_facts['pkg_mgr'] == 'portage'
|
|
||||||
|
|
||||||
- name: Apply service defaults
|
- name: Apply service defaults
|
||||||
template:
|
template:
|
||||||
src: "mysql_defaults.j2"
|
src: "mysql_defaults.j2"
|
||||||
dest: "/etc/default/mariadb"
|
dest: "/etc/default/mariadb"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
when:
|
|
||||||
- ansible_facts['pkg_mgr'] != 'portage'
|
|
||||||
notify:
|
notify:
|
||||||
- Manage LB
|
- Manage LB
|
||||||
- Restart all mysql
|
- Restart all mysql
|
||||||
@ -154,8 +142,6 @@
|
|||||||
dest: "/etc/default/mysql"
|
dest: "/etc/default/mysql"
|
||||||
state: "link"
|
state: "link"
|
||||||
force: "yes"
|
force: "yes"
|
||||||
when:
|
|
||||||
- ansible_facts['pkg_mgr'] != 'portage'
|
|
||||||
|
|
||||||
- name: remove default mysql_safe_syslog
|
- name: remove default mysql_safe_syslog
|
||||||
file:
|
file:
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2019, Matthew Thode
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
## APT Cache Options
|
|
||||||
cache_timeout: 600
|
|
||||||
|
|
||||||
# Default private device setting
|
|
||||||
_galera_disable_privatedevices: yes
|
|
||||||
|
|
||||||
galera_server_required_distro_packages:
|
|
||||||
- sys-apps/xinetd
|
|
||||||
|
|
||||||
galera_etc_conf_file: "/etc/mysql/my.cnf"
|
|
||||||
galera_etc_include_dir: "/etc/mysql/conf.d"
|
|
||||||
galera_var_run_socket: "/var/run/mysqld/mysqld.sock"
|
|
||||||
|
|
||||||
# The package name for mariaDB is set as a variable
|
|
||||||
# so that it can be used in debconf later in the
|
|
||||||
# "galera_common" role.
|
|
||||||
_galera_mariadb_server_package: "dev-db/mariadb"
|
|
||||||
|
|
||||||
# NB This is specifically galera_server_mariadb_distro_packages as these
|
|
||||||
# packages only get installed during the galera play - this is because of
|
|
||||||
# the preseed task and the service startup control used when installing
|
|
||||||
# mariadb-galera-server and galera.
|
|
||||||
galera_server_mariadb_distro_packages:
|
|
||||||
- "{{ galera_mariadb_server_package }}"
|
|
||||||
- sys-cluster/galera
|
|
||||||
- net-misc/rsync
|
|
||||||
- net-misc/socat
|
|
||||||
- dev-python/mysql-python
|
|
||||||
|
|
||||||
# The packages to uninstall during an upgrade from a previous version
|
|
||||||
galera_server_upgrade_packages_remove:
|
|
||||||
|
|
||||||
galera_wsrep_provider: "/usr/lib64/galera/libgalera_smm.so"
|
|
@ -32,7 +32,7 @@ galera_server_required_distro_packages:
|
|||||||
- libgcrypt
|
- libgcrypt
|
||||||
- MariaDB-client
|
- MariaDB-client
|
||||||
- MariaDB-devel
|
- MariaDB-devel
|
||||||
- "{{ ansible_facts['distribution_major_version'] is version('8', '<') | ternary('MySQL-python', 'python3-PyMySQL') }}" # needed by mysql_user
|
- python3-PyMySQL
|
||||||
- xinetd
|
- xinetd
|
||||||
|
|
||||||
galera_etc_conf_file: "/etc/mysql/my.cnf"
|
galera_etc_conf_file: "/etc/mysql/my.cnf"
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2017, SUSE LINUX GmbH.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
# Galera GPG Keys
|
|
||||||
_galera_gpg_keys:
|
|
||||||
# MariaDB Package Signing Key <package-signing-key@mariadb.org>
|
|
||||||
- key: /etc/pki/RPM-GPG-KEY-MariaDB
|
|
||||||
|
|
||||||
# Default private device setting
|
|
||||||
_galera_disable_privatedevices: yes
|
|
||||||
|
|
||||||
galera_server_required_distro_packages:
|
|
||||||
- galera
|
|
||||||
- gpg2
|
|
||||||
- libaio-devel
|
|
||||||
- libstdc++-devel
|
|
||||||
- libgcrypt-devel
|
|
||||||
- MariaDB-client
|
|
||||||
- MariaDB-devel
|
|
||||||
- python-MySQL-python # needed by mysql_user
|
|
||||||
- python3-PyMySQL
|
|
||||||
- xinetd
|
|
||||||
|
|
||||||
galera_etc_conf_file: "/etc/mysql/my.cnf"
|
|
||||||
galera_etc_include_dir: "/etc/mysql/conf.d"
|
|
||||||
galera_var_run_socket: "/var/lib/mysql/mysql.sock"
|
|
||||||
|
|
||||||
_galera_mariadb_server_package: "MariaDB-server"
|
|
||||||
|
|
||||||
galera_server_mariadb_distro_packages:
|
|
||||||
- which
|
|
||||||
- "{{ galera_mariadb_server_package }}"
|
|
||||||
- MariaDB-backup
|
|
||||||
- MariaDB-shared
|
|
||||||
- rsync
|
|
||||||
- socat
|
|
||||||
|
|
||||||
# Conflicting packages with those from the MariaDB repository
|
|
||||||
galera_mariadb_distro_packages_remove:
|
|
||||||
- libmariadb-devel
|
|
||||||
- mariadb
|
|
||||||
- mariadb-client
|
|
||||||
- mariadb-tools
|
|
||||||
|
|
||||||
# The packages to uninstall during an upgrade from a previous version
|
|
||||||
galera_server_upgrade_packages_remove:
|
|
||||||
- MariaDB-Galera-server
|
|
||||||
- MariaDB-server
|
|
||||||
|
|
||||||
_galera_opensuse_dir: "{{ ansible_facts['distribution_major_version'] }}"
|
|
||||||
_galera_repo_url: "http://{{ galera_repo_host }}/MariaDB/mariadb-{{ galera_major_version }}.{{ galera_minor_version }}/yum/opensuse{{ _galera_opensuse_dir }}-amd64"
|
|
||||||
_galera_repo:
|
|
||||||
name: MariaDB
|
|
||||||
description: "MariaDB Repo"
|
|
||||||
baseurl: "{{ galera_repo_url }}"
|
|
||||||
|
|
||||||
galera_wsrep_provider: "/usr/lib64/galera/libgalera_smm.so"
|
|
||||||
galera_unix_socket: "/var/lib/mysqld/mysqld.sock"
|
|
||||||
|
|
||||||
mariadb_delete_etc_conf_files:
|
|
||||||
- default_plugins.cnf
|
|
||||||
- galera.cnf
|
|
||||||
- error_log.cnf
|
|
||||||
|
|
||||||
galera_client_distro_packages:
|
|
||||||
- MariaDB-client
|
|
Loading…
x
Reference in New Issue
Block a user