[stable-2.9] Fix setup_mysql8 tests for CentOS 8 (#64868) (#64926)

(cherry picked from commit 41f301fe1b)

Co-authored-by: Sam Doran <sdoran@redhat.com>
pull/65015/head^2
Sam Doran 6 years ago committed by Matt Davis
parent e5b13bb9e3
commit 1c1a950a2d

@ -1,10 +1,16 @@
repo_link: https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
repo_name: mysql-community
repo_link: https://repo.mysql.com/mysql80-community-release-el{{ ansible_facts.distribution_major_version }}.rpm
my_cnf: /etc/my.cnf
mysql_packages:
- mysql-community-server
mysql_data_dirs:
- /var/lib/mysql
- /usr/mysql
mysql_support_packages:
- MySQL-python
mysql_server_packages:
- mysql-community-server
mysql_cleanup_packages:
- mysql-community-client
- mysql-community-common
@ -12,3 +18,4 @@ mysql_cleanup_packages:
- mysql-community-libs-compat
- mysql-community-server
- mysql80-community-release
- python3-PyMySQL

@ -5,14 +5,19 @@
listen: cleanup mysql8
- name: remove repo
yum:
name: mysql80-community-release
state: absent
# yum:
# name: mysql80-community-release
# state: absent
# Work around for a bug in the dnf module. Use the module once that gets fixed.
# https://github.com/ansible/ansible/issues/64294
command: "{{ ansible_facts.pkg_mgr}} -y erase mysql80-community-release"
args:
warn: no
listen: cleanup mysql8
- name: remove mysql packages
yum:
name: '{{ mysql_packages | union(mysql_cleanup_packages) }}'
name: '{{ mysql_support_packages | union(mysql_server_packages) | union(mysql_cleanup_packages) }}'
state: absent
listen: cleanup mysql8

@ -6,9 +6,16 @@
name: '{{ repo_link }}'
notify: cleanup mysql8
# These packages come from AppStream in RHEL 8, so they need to be done in a separate task
- name: Install MySQL support packages
yum:
name: "{{ mysql_support_packages }}"
notify: cleanup mysql8
- name: Install MySQL community server
yum:
name: '{{ mysql_packages }}'
name: '{{ mysql_server_packages }}'
disablerepo: '{{ mysql_disablerepo | default(omit) }}'
notify: cleanup mysql8
- name: Copy my.cnf

@ -0,0 +1,4 @@
mysql_support_packages:
- python3-PyMySQL
mysql_disablerepo: AppStream

@ -0,0 +1,4 @@
mysql_support_packages:
- python3-PyMySQL
mysql_disablerepo: rhel-8-for-x86_64-appstream-rpms

@ -1,3 +0,0 @@
mysql_data_dirs:
- /var/lib/mysql
- /usr/mysql
Loading…
Cancel
Save