diff --git a/tasks/manage_node_state.yml b/tasks/manage_node_state.yml index c8e8369..ae49acf 100644 --- a/tasks/manage_node_state.yml +++ b/tasks/manage_node_state.yml @@ -6,6 +6,9 @@ become: true when: inventory_hostname == item +- name: manage_node_state | Populate service facts + ansible.builtin.service_facts: + - name: manage_node_state | reset failed status (otherwise service can't be stopped) command: "systemctl reset-failed {{ mariadb_systemd_service_name }}" # noqa command-instead-of-module become: true @@ -14,6 +17,7 @@ when: - '"stopped" in mariadb_systemd_service_state' - inventory_hostname == item + - '"failed" in ansible_facts.services[mariadb_systemd_service_name].state' - name: manage_node_state | ensure node is fully stopped before continuing ansible.builtin.service: diff --git a/vars/almalinux-8.yml b/vars/almalinux-8.yml index 1fb84fb..db45145 100644 --- a/vars/almalinux-8.yml +++ b/vars/almalinux-8.yml @@ -10,7 +10,7 @@ mariadb_packages: mariabackup_packages: - "MariaDB-backup" mariadb_certificates_dir: "/etc/my.cnf.d/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - name: "etc/my.cnf.d/server.cnf" mariadb_temp_confs: diff --git a/vars/almalinux-9.yml b/vars/almalinux-9.yml index 413f1e0..0fc07ce 100644 --- a/vars/almalinux-9.yml +++ b/vars/almalinux-9.yml @@ -11,7 +11,7 @@ mariadb_packages: mariabackup_packages: - "MariaDB-backup" mariadb_certificates_dir: "/etc/my.cnf.d/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - "etc/my.cnf.d/server.cnf" mariadb_temp_confs: diff --git a/vars/centos-8.yml b/vars/centos-8.yml index 1fb84fb..db45145 100644 --- a/vars/centos-8.yml +++ b/vars/centos-8.yml @@ -10,7 +10,7 @@ mariadb_packages: mariabackup_packages: - "MariaDB-backup" mariadb_certificates_dir: "/etc/my.cnf.d/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - name: "etc/my.cnf.d/server.cnf" mariadb_temp_confs: diff --git a/vars/centos-9.yml b/vars/centos-9.yml index 413f1e0..0fc07ce 100644 --- a/vars/centos-9.yml +++ b/vars/centos-9.yml @@ -11,7 +11,7 @@ mariadb_packages: mariabackup_packages: - "MariaDB-backup" mariadb_certificates_dir: "/etc/my.cnf.d/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - "etc/my.cnf.d/server.cnf" mariadb_temp_confs: diff --git a/vars/debian-11.yml b/vars/debian-11.yml index 81bf31a..cf0405c 100644 --- a/vars/debian-11.yml +++ b/vars/debian-11.yml @@ -12,7 +12,7 @@ mariadb_packages: mariabackup_packages: - "mariadb-backup" mariadb_certificates_dir: "/etc/mysql/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - name: "etc/mysql/debian.cnf" mode: "0600" diff --git a/vars/debian-12.yml b/vars/debian-12.yml index 81bf31a..cf0405c 100644 --- a/vars/debian-12.yml +++ b/vars/debian-12.yml @@ -12,7 +12,7 @@ mariadb_packages: mariabackup_packages: - "mariadb-backup" mariadb_certificates_dir: "/etc/mysql/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - name: "etc/mysql/debian.cnf" mode: "0600" diff --git a/vars/debian.yml b/vars/debian.yml index 7b54d66..a92ee18 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -13,7 +13,7 @@ mariadb_packages: mariabackup_packages: - "mariadb-backup" mariadb_certificates_dir: "/etc/mysql/certificates" -mariadb_systemd_service_name: "mysql" +mariadb_systemd_service_name: "mysql.service" mariadb_confs: - name: "etc/mysql/debian.cnf" mode: "0600" diff --git a/vars/fedora.yml b/vars/fedora.yml index da42ddd..46216a1 100644 --- a/vars/fedora.yml +++ b/vars/fedora.yml @@ -8,7 +8,7 @@ mariadb_packages: mariabackup_packages: - "MariaDB-backup" mariadb_certificates_dir: "/etc/my.cnf.d/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - name: "etc/my.cnf.d/server.cnf" mariadb_temp_confs: diff --git a/vars/redhat.yml b/vars/redhat.yml index 9852a6d..22efefb 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -8,7 +8,7 @@ mariadb_packages: mariabackup_packages: - "MariaDB-backup" mariadb_certificates_dir: "/etc/my.cnf.d/certificates" -mariadb_systemd_service_name: "mysql" +mariadb_systemd_service_name: "mysql.service" mariadb_confs: - name: "etc/my.cnf.d/server.cnf" mariadb_temp_confs: diff --git a/vars/rocky-8.yml b/vars/rocky-8.yml index c0f55ad..463ef66 100644 --- a/vars/rocky-8.yml +++ b/vars/rocky-8.yml @@ -11,7 +11,7 @@ mariadb_packages: mariabackup_packages: - "MariaDB-backup" mariadb_certificates_dir: "/etc/my.cnf.d/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - name: "etc/my.cnf.d/server.cnf" mariadb_temp_confs: diff --git a/vars/rocky-9.yml b/vars/rocky-9.yml index cd755ea..d66db39 100644 --- a/vars/rocky-9.yml +++ b/vars/rocky-9.yml @@ -11,7 +11,7 @@ mariadb_packages: mariabackup_packages: - "MariaDB-backup" mariadb_certificates_dir: "/etc/my.cnf.d/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - name: "etc/my.cnf.d/server.cnf" mariadb_temp_confs: diff --git a/vars/ubuntu-20.yml b/vars/ubuntu-20.yml index b5b0caf..41befb4 100644 --- a/vars/ubuntu-20.yml +++ b/vars/ubuntu-20.yml @@ -11,7 +11,7 @@ mariadb_packages: mariabackup_packages: - "mariadb-backup" mariadb_certificates_dir: "/etc/mysql/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - name: "etc/mysql/debian.cnf" - name: "etc/mysql/my.cnf" diff --git a/vars/ubuntu-22.yml b/vars/ubuntu-22.yml index b5b0caf..41befb4 100644 --- a/vars/ubuntu-22.yml +++ b/vars/ubuntu-22.yml @@ -11,7 +11,7 @@ mariadb_packages: mariabackup_packages: - "mariadb-backup" mariadb_certificates_dir: "/etc/mysql/certificates" -mariadb_systemd_service_name: "mariadb" +mariadb_systemd_service_name: "mariadb.service" mariadb_confs: - name: "etc/mysql/debian.cnf" - name: "etc/mysql/my.cnf"