Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Ansible/library/get_db_facts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion Ansible/roles/cloudstack-manager/tasks/centos8-acs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }} "
Expand Down
2 changes: 1 addition & 1 deletion Ansible/roles/cloudstack-manager/tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Ansible/roles/cloudstack-manager/tasks/el9-acs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }} "
Expand Down
2 changes: 1 addition & 1 deletion Ansible/roles/marvin/tasks/install_marvin_prereqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
- texttable
- lxml
- pycparser
- mysql-connector-python==8.0.30
- mysql-connector-python==8.0.31
- netaddr
- pyvmomi
tags:
Expand Down
22 changes: 21 additions & 1 deletion Ansible/roles/mysql/tasks/centos8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 20 additions & 0 deletions Ansible/roles/mysql/tasks/el9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Ansible/roles/mysql/tasks/mysql_replication.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Ansible/roles/mysql/templates/my-centos8.cnf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down