diff --git a/Ansible/library/get_db_facts b/Ansible/library/get_db_facts index 79b423912f..f8de199c45 100644 --- a/Ansible/library/get_db_facts +++ b/Ansible/library/get_db_facts @@ -18,9 +18,9 @@ DBHOST=`echo $ARGS | tr " " "\n"| awk -F= '$1=="DBHOST"{print $2}'| tr -d '"' | DBUSER=`echo $ARGS | tr " " "\n"| awk -F= '$1=="DBUSER"{print $2}'| tr -d '"' | sed -e 's/[[:space:]]*$//'` DBPASS=`echo $ARGS | tr " " "\n"| awk -F= '$1=="DBPASSWORD"{print $2}'| tr -d '"' | sed -e 's/[[:space:]]*$//'` -master_status=`mysql -h $DBHOST -u $DBUSER -p$DBPASS -e \ "show master status;"` -master_file=`echo $master_status | awk -F ' ' '{print $5}'` -master_pos=`echo $master_status | awk -F ' ' '{print $6}'` +master_status=`mysql -h $DBHOST -u $DBUSER -p$DBPASS -e \ "SHOW BINARY LOG STATUS;"` +master_file=`echo $master_status | awk -F ' ' '{print $6}'` +master_pos=`echo $master_status | awk -F ' ' '{print $7}'` clouddb_test=`mysql -h $DBHOST -u $DBUSER -p$DBPASS -e \ "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'cloud';"` if [[ -n $clouddb_test ]]; then registered_mgmt_servers=`mysql -h $DBHOST -u $DBUSER -p$DBPASS -e \ "SELECT service_ip FROM cloud.mshost where removed is null;" | grep -vE service_ip` diff --git a/Ansible/roles/cloudstack-manager/tasks/centos8-acs.yml b/Ansible/roles/cloudstack-manager/tasks/centos8-acs.yml index 8a00fd9006..667903b6ae 100644 --- a/Ansible/roles/cloudstack-manager/tasks/centos8-acs.yml +++ b/Ansible/roles/cloudstack-manager/tasks/centos8-acs.yml @@ -16,7 +16,7 @@ - name: Ensure python pre-req mysql repo is installed dnf: - name: http://repo.mysql.com/mysql80-community-release-el8.rpm + name: http://repo.mysql.com/mysql84-community-release-el8.rpm state: present - name: "Setup Apache Cloudstack Repo file. baseurl={{ baseurl_cloudstack }} " diff --git a/Ansible/roles/cloudstack-manager/tasks/debian.yml b/Ansible/roles/cloudstack-manager/tasks/debian.yml index 8945d62600..dcb63c9353 100644 --- a/Ansible/roles/cloudstack-manager/tasks/debian.yml +++ b/Ansible/roles/cloudstack-manager/tasks/debian.yml @@ -80,7 +80,7 @@ update_cache: yes - name: Install python3-mysql.connector DEB package for cloudstack-management as the real package name is mysql-connector-python-py3 - shell: 'wget http://launchpadlibrarian.net/717081070/python3-mysql.connector_8.0.15-4_all.deb -O /tmp/python3-mysql.connector_8.0.15-4_all.deb && DEBIAN_FRONTEND=noninteractive apt install -y /tmp/python3-mysql.connector_8.0.15-4_all.deb' + shell: 'wget http://ftp.debian.org/debian/pool/main/m/mysql-connector-python/python3-mysql.connector_9.5.0-1_all.deb -O /tmp/python3-mysql.connector_9.5.0-1_all.deb && DEBIAN_FRONTEND=noninteractive apt install -y /tmp/python3-mysql.connector_9.5.0-1_all.deb' - name: Ensure CloudStack management-server only is installed (we install usage server later) apt: diff --git a/Ansible/roles/cloudstack-manager/tasks/el9-acs.yml b/Ansible/roles/cloudstack-manager/tasks/el9-acs.yml index 216ed7fbe3..f185611c55 100644 --- a/Ansible/roles/cloudstack-manager/tasks/el9-acs.yml +++ b/Ansible/roles/cloudstack-manager/tasks/el9-acs.yml @@ -16,7 +16,7 @@ - name: Ensure python pre-req mysql repo is installed for el9 dnf: - name: http://repo.mysql.com/mysql80-community-release-el9.rpm + name: http://repo.mysql.com/mysql84-community-release-el9.rpm state: present - name: "Setup Apache Cloudstack Repo file. baseurl={{ baseurl_cloudstack }} " diff --git a/Ansible/roles/marvin/tasks/install_marvin_prereqs.yml b/Ansible/roles/marvin/tasks/install_marvin_prereqs.yml index 4d6e641c6c..82753c0b46 100644 --- a/Ansible/roles/marvin/tasks/install_marvin_prereqs.yml +++ b/Ansible/roles/marvin/tasks/install_marvin_prereqs.yml @@ -100,7 +100,7 @@ - texttable - lxml - pycparser - - mysql-connector-python==8.0.30 + - mysql-connector-python==8.0.31 - netaddr - pyvmomi tags: diff --git a/Ansible/roles/mysql/tasks/centos8.yml b/Ansible/roles/mysql/tasks/centos8.yml index a3183f539a..9d2830fd8e 100644 --- a/Ansible/roles/mysql/tasks/centos8.yml +++ b/Ansible/roles/mysql/tasks/centos8.yml @@ -52,9 +52,29 @@ - mysql - mysqlconf +- name: Disable OS MySQL module + command: dnf module disable mysql -y + tags: + - mysql + - mysqlconf + +- name: Install MySQL 8.4 repo for el8 + dnf: + name: http://repo.mysql.com/mysql84-community-release-el8.rpm + state: present + tags: + - mysql + - mysqlconf + +- name: Enable MySQL 8.4 module + command: dnf module enable mysql:8.4 -y + tags: + - mysql + - mysqlconf + - name: Ensure mysql server is installed dnf: - name: mysql-server + name: mysql*-server state: present register: mysqlinstalled tags: diff --git a/Ansible/roles/mysql/tasks/el9.yml b/Ansible/roles/mysql/tasks/el9.yml index 52c89c5cec..70840b6ff6 100644 --- a/Ansible/roles/mysql/tasks/el9.yml +++ b/Ansible/roles/mysql/tasks/el9.yml @@ -60,6 +60,26 @@ - mysql - mysqlconf +- name: Disable OS MySQL module + command: dnf module disable mysql -y + tags: + - mysql + - mysqlconf + +- name: Install MySQL 8.4 repo for el9 + dnf: + name: http://repo.mysql.com/mysql84-community-release-el9.rpm + state: present + tags: + - mysql + - mysqlconf + +- name: Enable MySQL 8.4 module + command: dnf module enable mysql:8.4 -y + tags: + - mysql + - mysqlconf + - name: Ensure mysql server is installed dnf: name: mysql*-server diff --git a/Ansible/roles/mysql/tasks/mysql_replication.yml b/Ansible/roles/mysql/tasks/mysql_replication.yml index cb56afc94f..d16528a8ee 100644 --- a/Ansible/roles/mysql/tasks/mysql_replication.yml +++ b/Ansible/roles/mysql/tasks/mysql_replication.yml @@ -46,18 +46,18 @@ mysql_replication: mode=changemaster master_host={{ hostvars[groups['mysql_master_host'][0]]['ansible_ssh_host'] }} master_log_file={{ master_file }} master_log_pos={{ master_pos }} master_user=replication_user master_password={{ mysql_replication_password }} login_user=root login_password={{ mysql_root_password }} when: ("mysql_slave_hosts" in group_names) and ("{{ cloudbd_exists }}" == "no") -- name: Start Slave +- name: Start Replica mysql_replication: mode=startslave login_user=root login_password={{ mysql_root_password }} when: ("mysql_slave_hosts" in group_names) and ("{{ cloudbd_exists }}" == "no") -- name: Show Master Status +- name: Show Binary Log Status mysql_replication: mode=getmaster login_user=root login_password={{ mysql_root_password }} when: ("mysql_master_host" in group_names) and ("{{ cloudbd_exists }}" == "no") register: masterstatus - debug: msg="Master status is {{ masterstatus }}" -- name: Show Slave Status +- name: Show Replica Status mysql_replication: mode=getslave login_user=root login_password={{ mysql_root_password }} when: ("mysql_slave_hosts" in group_names) and ("{{ cloudbd_exists }}" == "no") register: slavestatus diff --git a/Ansible/roles/mysql/templates/my-centos8.cnf.j2 b/Ansible/roles/mysql/templates/my-centos8.cnf.j2 index 50a5c6979b..3a99b121fa 100644 --- a/Ansible/roles/mysql/templates/my-centos8.cnf.j2 +++ b/Ansible/roles/mysql/templates/my-centos8.cnf.j2 @@ -23,7 +23,7 @@ max_connections={{ mysql_max_connections }} skip_name_resolve {% if ansible_distribution_major_version|int < 10 %} -default_authentication_plugin=mysql_native_password +authentication_policy=caching_sha2_password {% endif %} innodb_buffer_pool_size={{ mysql_innodb_buffer_pool_size }}