From 5c01d5333cd5deeb34c5021e0fd53d82847e1181 Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Mon, 3 Jun 2024 17:22:52 +0530 Subject: [PATCH 1/2] PMM-7 Handle installation of mysql 8.0 --- tasks/install_and_add_to_pmm_ps_80.yml | 16 ++++++++++------ templates/my_80.j2 | 3 +++ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 templates/my_80.j2 diff --git a/tasks/install_and_add_to_pmm_ps_80.yml b/tasks/install_and_add_to_pmm_ps_80.yml index b5abd8230..85d1d8cc7 100644 --- a/tasks/install_and_add_to_pmm_ps_80.yml +++ b/tasks/install_and_add_to_pmm_ps_80.yml @@ -1,9 +1,10 @@ -# This task installs and starts Percona Server 5.7 on CentOS and Debian/Ubuntu +--- +# This task installs and starts Percona Server 8.0 on CentOS and Debian/Ubuntu # # Task adjustments are handled by parent playbook vars: # var "port_flag" : to access agent with custom port # ex: port_flag: "--pmm-agent-listen-port={{ custom_port }}" -# + - name: enable ps-80 release repo include_tasks: ./enable_repo.yml vars: @@ -30,13 +31,16 @@ shell: | init_pass=$(grep "temporary password" /var/log/mysqld.log | awk '{print $NF}' | tail -1) mysql --connect-expired-password -uroot --password="$init_pass" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'U?fY)9s7|3gxUm';" - cp ../templates/my_57.j2 /root/.my.cnf + cp ../templates/my_80.j2 /root/.my.cnf - name: copy .my.cnf with credentials on centos when: ansible_os_family == "RedHat" - template: src=../templates/my_57.j2 - dest=/root/.my.cnf - mode=0640 owner=root group=root + template: + src: ../templates/my_80.j2 + dest: /root/.my.cnf + mode: 0640 + owner: root + group: root - name: add mysql instance for monitoring when: ansible_os_family == "RedHat" diff --git a/templates/my_80.j2 b/templates/my_80.j2 new file mode 100644 index 000000000..e583ab425 --- /dev/null +++ b/templates/my_80.j2 @@ -0,0 +1,3 @@ +[client] +user=root +password=U?fY)9s7|3gxUm From b10f30b2f1e2f756e31f823e67201f461976bdac Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Mon, 3 Jun 2024 20:41:08 +0530 Subject: [PATCH 2/2] PMM-7 Hard-reset --- playbooks/pmm3-client_integration.yml | 2 +- tasks/pmm2-client_test_enabled_db.yml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/playbooks/pmm3-client_integration.yml b/playbooks/pmm3-client_integration.yml index 09e5b874e..2e897c6f2 100644 --- a/playbooks/pmm3-client_integration.yml +++ b/playbooks/pmm3-client_integration.yml @@ -56,7 +56,7 @@ # mysql_service_name: "mysql_{{ rnd }}_{{ instance_ip }}" - name: Install and start Percona Server 8.0 - when: '"ps-5.7" in enabled_db' + when: '"ps-8.0" in enabled_db' include_tasks: ../tasks/install_and_add_to_pmm_ps_80.yml - name: Verify if Metric Endpoint with Auth works for Mysqld Exporter diff --git a/tasks/pmm2-client_test_enabled_db.yml b/tasks/pmm2-client_test_enabled_db.yml index 761a5a528..7dfae7412 100644 --- a/tasks/pmm2-client_test_enabled_db.yml +++ b/tasks/pmm2-client_test_enabled_db.yml @@ -5,8 +5,7 @@ enabled_db: "{{ db_list|select|list }}" vars: db_list: - - "{{ (ansible_os_family == 'RedHat' and ansible_distribution_major_version < '9') | ternary('ps-8.0','') }}" - - "{{ (ansible_os_family == 'Debian') | ternary('ps-8.0','') }}" + - "ps-8.0" - "{{ (ansible_distribution == 'Debian' and ansible_distribution_major_version > '10') | ternary('psmdb-70','') }}" - "{{ (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version <= '18') | ternary('psmdb-60','') }}" - "{{ (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version > '18') | ternary('psmdb-70','') }}"