diff --git a/VERSIONS b/VERSIONS index 3951c3f51..d27b0246d 100644 --- a/VERSIONS +++ b/VERSIONS @@ -29,6 +29,9 @@ PSMDB40_VER="4.0.28-23" PSMDB42_VER="4.2.22-22" PSMDB44_VER="4.4.16-16" PSMDB50_VER="5.0.13-11" +PSMDB60_VER="6.0.0-0" +PSMDB70_VER="7.0.0-0" +PSMDB80_VER="8.0.0-0" PS56_VER="5.6.51-91.0" PS56_REV="b59139e" PS57_VER="5.7.44-56" diff --git a/molecule/pbm/install/tasks/main.yml b/molecule/pbm/install/tasks/main.yml index 98e563a48..ff64c5d7d 100644 --- a/molecule/pbm/install/tasks/main.yml +++ b/molecule/pbm/install/tasks/main.yml @@ -52,9 +52,9 @@ install_repo: "{{ lookup('env', 'install_repo') }}" when: lookup('env', 'install_repo') == "main" -- name: include tasks for PSMDB 4.0,4.2,4.4,5.0 install +- name: include tasks for PSMDB 4.0,4.2,4.4,5.0,6.0,7.0,8.0 install include_tasks: install_psmdb_full.yml - when: lookup('env', 'psmdb_to_test') == "psmdb-40" or lookup('env', 'psmdb_to_test') == "psmdb-42" or lookup('env', 'psmdb_to_test') == "psmdb-44" or lookup('env', 'psmdb_to_test') == "psmdb-50" + when: lookup('env', 'psmdb_to_test') == "psmdb-40" or lookup('env', 'psmdb_to_test') == "psmdb-42" or lookup('env', 'psmdb_to_test') == "psmdb-44" or lookup('env', 'psmdb_to_test') == "psmdb-50" or lookup('env', 'psmdb_to_test') == "psmdb-60" or lookup('env', 'psmdb_to_test') == "psmdb-70" or lookup('env', 'psmdb_to_test') == "psmdb-80" - name: include tasks for PSMDB 3.6 install include_tasks: install_psmdb_36_full.yml diff --git a/molecule/pbm/upgrade/tasks/main.yml b/molecule/pbm/upgrade/tasks/main.yml index 0b57f2e0e..5e455c17c 100644 --- a/molecule/pbm/upgrade/tasks/main.yml +++ b/molecule/pbm/upgrade/tasks/main.yml @@ -58,9 +58,9 @@ install_repo: "{{ lookup('env', 'install_repo') }}" when: lookup('env', 'install_repo') == "main" -- name: include tasks for PSMDB 4.0,4.2,4.4,5.0 install +- name: include tasks for PSMDB 4.0,4.2,4.4,5.0,6.0,7.0,8.0 install include_tasks: install_psmdb_full.yml - when: lookup('env', 'psmdb_to_test') == "psmdb-40" or lookup('env', 'psmdb_to_test') == "psmdb-42" or lookup('env', 'psmdb_to_test') == "psmdb-44" or lookup('env', 'psmdb_to_test') == "psmdb-50" + when: lookup('env', 'psmdb_to_test') == "psmdb-40" or lookup('env', 'psmdb_to_test') == "psmdb-42" or lookup('env', 'psmdb_to_test') == "psmdb-44" or lookup('env', 'psmdb_to_test') == "psmdb-50" or lookup('env', 'psmdb_to_test') == "psmdb-70" or lookup('env', 'psmdb_to_test') == "psmdb-80" - name: include tasks for PSMDB 3.6 install include_tasks: install_psmdb_36_full.yml diff --git a/package_check.sh b/package_check.sh index e5f91d858..154b4c8d9 100755 --- a/package_check.sh +++ b/package_check.sh @@ -125,6 +125,12 @@ elif [ $1 = "psmdb44" ]; then version=${PSMDB44_VER} elif [ $1 = "psmdb50" ]; then version=${PSMDB50_VER} +elif [ $1 = "psmdb60" ]; then + version=${PSMDB60_VER} +elif [ $1 = "psmdb70" ]; then + version=${PSMDB70_VER} +elif [ $1 = "psmdb80" ]; then + version=${PSMDB80_VER} elif [ $1 = "pmm" ]; then version=${PMM_VER} elif [ $1 = "pbm" ]; then @@ -429,7 +435,7 @@ elif [ "${product}" = "psmdb30" -o "${product}" = "psmdb32" -o "${product}" = "p fi done else - if [ "${product}" = "psmdb40" -o "${product}" = "psmdb42" -o "${product}" = "psmdb44" ]; then + if [ "${product}" = "psmdb40" -o "${product}" = "psmdb42" -o "${product}" = "psmdb44" -o "${product}" = "psmdb50" -o "${product}" = "psmdb60" -o "${product}" = "psmdb70" -o "${product}" = "psmdb80" ]; then psmdb_name="percona-server-mongodb" else psmdb_name="" diff --git a/playbooks/pmm2-client_integration_auth_config.yml b/playbooks/pmm2-client_integration_auth_config.yml index afed8df3c..69c1f6a8e 100644 --- a/playbooks/pmm2-client_integration_auth_config.yml +++ b/playbooks/pmm2-client_integration_auth_config.yml @@ -72,7 +72,7 @@ loop: - { service_name: '{{ mysql_service_name }}', metric: 'mysql_up 1' } -### start PSMDB 4.4 +### start PSMDB 4.4/5.0/6.0/7.0/8.0 - set_fact: mongo_service_name: "mongodb_{{ instance_ip }}_{{ ansible_distribution }}_{{ ansible_distribution_major_version }}" mongo_socket_service_name: "mongodb_socket_{{ instance_ip }}_{{ ansible_distribution }}_{{ ansible_distribution_major_version }}" diff --git a/playbooks/pt_with_products.yml b/playbooks/pt_with_products.yml index f7bc521e1..41638e4dd 100644 --- a/playbooks/pt_with_products.yml +++ b/playbooks/pt_with_products.yml @@ -1,7 +1,7 @@ --- # This playbook does following: # -# installs latest version of Percona-Server-57 (ps57), Percona-Server-80 (ps80), Percona-XtraDB-Cluster-57 (pxc57), Percona-XtraDB-Cluster-80 (pxc80), MysqL server 57 (upstream57), MySQL server 80 (upstream80), Percona Server for MongoDB 44 (psmdb44), Percona Server for MongoDB 50 (psmdb50). +# installs latest version of Percona-Server-57 (ps57), Percona-Server-80 (ps80), Percona-XtraDB-Cluster-57 (pxc57), Percona-XtraDB-Cluster-80 (pxc80), MysqL server 57 (upstream57), MySQL server 80 (upstream80), Percona Server for MongoDB 44 (psmdb44), Percona Server for MongoDB 50 (psmdb50), Percona Server for MongoDB 60 (psmdb60), Percona Server for MongoDB 70 (psmdb70), Percona Server for MongoDB 80 (psmdb80). # enables Percona pt repository # installs latest version of Percona-Toolkit (pt) and runs one of the pt (pt-mysql-summary or pt-psmdb-summary) @@ -28,6 +28,10 @@ include_tasks: ../tasks/install_and_run_ps80.yml when: lookup('env', 'install_with') == "ps80" + - name: include tasks for installing and setup ps80 + include_tasks: ../tasks/install_and_run_ps84.yml + when: lookup('env', 'install_with') == "ps84" + - name: include tasks for installing and setup pxc57 include_tasks: ../tasks/install_and_run_pxc57.yml when: lookup('env', 'install_with') == "pxc57" @@ -35,6 +39,10 @@ - name: include tasks for installing and setup pxc80 include_tasks: ../tasks/install_and_run_pxc80.yml when: lookup('env', 'install_with') == "pxc80" + + - name: include tasks for installing and setup pxc80 + include_tasks: ../tasks/install_and_run_pxc84.yml + when: lookup('env', 'install_with') == "pxc84" - name: include tasks for installing and setup upstream57 include_tasks: ../tasks/install_and_run_upstream57.yml @@ -56,6 +64,14 @@ include_tasks: ../tasks/install_and_run_psmdb.yml when: lookup('env', 'install_with') == "psmdb60" + - name: include tasks for installing and setup psmdb 70 + include_tasks: ../tasks/install_and_run_psmdb.yml + when: lookup('env', 'install_with') == "psmdb70" + + - name: include tasks for installing and setup psmdb 80 + include_tasks: ../tasks/install_and_run_psmdb.yml + when: lookup('env', 'install_with') == "psmdb80" + # Enable only pt repo to install pt - name: include tasks for enabling pt testing repo include_tasks: ../tasks/enable_only_repo_for_pt.yml @@ -95,4 +111,4 @@ when: lookup('env', 'install_with') is match('(pxc|ps|upstream)(57|80)$') - name: remove pt packages - include_tasks: ../tasks/remove_pt.yml + include_tasks: ../tasks/remove_pt.yml \ No newline at end of file diff --git a/repo_tests/install_psmdb.yml b/repo_tests/install_psmdb.yml index a63b3cab6..a863a80eb 100644 --- a/repo_tests/install_psmdb.yml +++ b/repo_tests/install_psmdb.yml @@ -24,7 +24,7 @@ when: ansible_os_family == "Debian" # - # Install PSMDB 4.0 packages + # Install PSMDB 4.0/4.2/4.4/5.0/6.0/7.0/8.0 packages # - name: Install psmdb packages in debian apt: diff --git a/tasks/Install_and_run_ps84.yml b/tasks/Install_and_run_ps84.yml new file mode 100644 index 000000000..68ada547e --- /dev/null +++ b/tasks/Install_and_run_ps84.yml @@ -0,0 +1,38 @@ +# This task enables Percona-Server-84 (ps84) main repository, installs and starts percona-server. + +# Enable ps84 main repo and install ps84 + - name: include tasks for enabling ps84 main repo + include_tasks: ../tasks/enable_ps84_main_repo.yml + + - name: include tasks for installing ps84 packages + vars: + packages: percona-server-server + include_tasks: + file: ../tasks/install_ps84.yml + apply: + environment: + PERCONA_TELEMETRY_URL: "https://check-dev.percona.com/v1/telemetry/GenericReport" + +# Start mysql service + - name: start mysql service on Debian + service: + name: mysql + state: started + when: ansible_os_family == "Debian" + + - name: start mysql service on CentOS + systemd: + name: mysql + state: started + when: ansible_os_family == "RedHat" + +# On Centos ps is started with random root password. Change ps root password and create cnf with new client password on centos. + - name: set root password on CentOS + command: ../setpass_57.sh + when: ansible_os_family == "RedHat" + + - name: copy .my.cnf with credentials on CentOS + template: src=../templates/my_57.j2 + dest=/root/.my.cnf + mode=0640 owner=root group=root + when: ansible_os_family == "RedHat" diff --git a/tasks/install_and_run_psmdb.yml b/tasks/install_and_run_psmdb.yml index 8d684ac60..e6ba4fbe4 100644 --- a/tasks/install_and_run_psmdb.yml +++ b/tasks/install_and_run_psmdb.yml @@ -1,4 +1,4 @@ -# This task enables Percona Server for MongoDB 44 (psmdb44) and MongoDB 50 (psmdb50) main repository, installs and starts modgodb. +# This task enables Percona Server for MongoDB 44 (psmdb44), MongoDB 50 (psmdb50), MongoDB 60 (psmdb60), MongoDB 70 (psmdb70), and MongoDB 80 (psmdb80) main repository, installs and starts modgodb. # Enable psmdb repo and install psmdb - name: include tasks for enabling psmdb 44 repo @@ -19,6 +19,18 @@ psmdb_repo: "psmdb-60 release" when: lookup('env', 'install_with') == "psmdb60" + - name: include tasks for enabling psmdb 70 repo + include_tasks: ../tasks/enable_psmdb_repo.yml + vars: + psmdb_repo: "psmdb-70 release" + when: lookup('env', 'install_with') == "psmdb70" + + - name: include tasks for enabling psmdb 80 repo + include_tasks: ../tasks/enable_psmdb_repo.yml + vars: + psmdb_repo: "psmdb-80 release" + when: lookup('env', 'install_with') == "psmdb80" + - name: include tasks for installing psmdb packages vars: packages: percona-server-mongodb diff --git a/tasks/install_and_run_pxc84.yml b/tasks/install_and_run_pxc84.yml new file mode 100644 index 000000000..3a2e04f80 --- /dev/null +++ b/tasks/install_and_run_pxc84.yml @@ -0,0 +1,98 @@ +# This task enables Percona XtraDB Cluster 84 (pxc84) main repository, installs and bootstraps one node of Percona XtraDB Cluster-84. + +# Enable pxc main repo and install pxc packages + - name: include tasks for enabling pxc 84 repo + include_tasks: ../tasks/enable_pxc84_main_repo.yml + + - name: install PXC 8 deb packages + apt: + name: "{{ packages }}" + update_cache: yes + vars: + packages: + - percona-xtradb-cluster-full + when: ansible_os_family == "Debian" + environment: + PERCONA_TELEMETRY_URL: "https://check-dev.percona.com/v1/telemetry/GenericReport" + + - name: install PXC 8 rpm packages + yum: + name: "{{ packages }}" + state: latest + vars: + packages: + - percona-xtradb-cluster-full + when: + - ansible_facts['distribution'] in ["RedHat", "CentOS", "OracleLinux", "Amazon"] + - ansible_facts['distribution_major_version'] | int <= 7 + environment: + PERCONA_TELEMETRY_URL: "https://check-dev.percona.com/v1/telemetry/GenericReport" + + - name: install PXC 8 rpm packages + dnf: + name: "{{ packages }}" + state: latest + vars: + packages: + - percona-xtradb-cluster-full + when: + - ansible_facts['distribution'] in ["RedHat", "CentOS", "OracleLinux", "Amazon"] + - ansible_facts['distribution_major_version'] | int >= 8 + environment: + PERCONA_TELEMETRY_URL: "https://check-dev.percona.com/v1/telemetry/GenericReport" + +# Define node IP for PXC config (Used by Debian distros) + - debug: + var: ansible_all_ipv4_addresses + + - set_fact: + man_ip: "{{ item }}" + with_items: "{{ ansible_all_ipv4_addresses }}" + when: "item.startswith('10.')" + + - name: output IP used to bootstrap pxc node by deb packages + debug: + var: man_ip + +# Stop mysql service and bootstrap pxc node + - name: stop mysql service with service command except OL9 + command: service mysql stop + when: (ansible_os_family == "Debian") or (ansible_os_family == "RedHat" and ansible_distribution_major_version != "9") + + - name: stop mysql service with systemctl command OL9 + command: systemctl stop mysql + when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "9" + + - name: copy pxc config on centos + template: src=../templates/my_rpm_80.j2 + dest=/etc/my.cnf + when: ansible_os_family == "RedHat" + + - name: copy pxc config on debian/ubuntu + template: src=../templates/my_8.j2 + dest=/etc/mysql/my.cnf + mode=0640 owner=mysql group=root + when: ansible_os_family == "Debian" + + - name: copy pxc certs + copy: + src: ../support-files/certs/ + dest: /etc/mysql/certs/ + + # bootstrap the pxc node + - name: bootstrap cluster + systemd: + name: mysql@bootstrap.service + state: started + + # On Centos ps is started with random root password. Change ps root password and create cnf with new client password on centos. + - name: set root password on centos + command: ../setpass_57.sh + when: ansible_os_family == "RedHat" + + - name: copy .my.cnf with credentials on centos + template: src=../templates/my_57.j2 + dest=/root/.my.cnf + mode=0640 owner=root group=root + when: ansible_os_family == "RedHat" + diff --git a/version_check.sh b/version_check.sh index fde52e4fe..e787ebcd3 100755 --- a/version_check.sh +++ b/version_check.sh @@ -140,6 +140,12 @@ elif [ "$1" = "psmdb44" ]; then version=${PSMDB44_VER} elif [ "$1" = "psmdb50" ]; then version=${PSMDB50_VER} +elif [ "$1" = "psmdb60" ]; then + version=${PSMDB60_VER} +elif [ "$1" = "psmdb70" ]; then + version=${PSMDB70_VER} +elif [ "$1" = "psmdb80" ]; then + version=${PSMDB80_VER} else echo "Illegal product selected!" exit 1 @@ -345,7 +351,7 @@ elif [ ${product} = "pbm" ]; then echo "${product} revision is correct and ${revision}" >> "${log}" fi -elif [ ${product} = "psmdb34" -o ${product} = "psmdb36" -o ${product} = "psmdb40" -o ${product} = "psmdb42" -o ${product} = "psmdb44" ]; then +elif [ ${product} = "psmdb34" -o ${product} = "psmdb36" -o ${product} = "psmdb40" -o ${product} = "psmdb42" -o ${product} = "psmdb44" -o ${product} = "psmdb50" -o ${product} = "psmdb60" -o ${product} = "psmdb70" -o ${product} = "psmdb80" ]; then ##PSMDB-544 declare -A new_bin_version=(["3.6"]="21" ["4.0"]="22" ["4.2"]="11" ["4.4"]="2") ver="${version%-*}"; major_ver="${ver%.*}"; minor_ver="${ver##*.}"