diff --git a/test/integration/targets/setup_mariadb/defaults/main.yml b/test/integration/targets/setup_mariadb/defaults/main.yml index a20d333add5..5ab08dc89cf 100644 --- a/test/integration/targets/setup_mariadb/defaults/main.yml +++ b/test/integration/targets/setup_mariadb/defaults/main.yml @@ -20,5 +20,14 @@ standby_port: 3307 standby_datadir: /var/lib/mysql_standby standby_logdir: /var/log/mysql_standby +default_datadir: /var/lib/mysql default_logdir: /var/log/mariadb mysql_safe_err_log: /var/log/mariadb/mysql_safe-err.log + +fs_objects_to_clean_up: +- "{{ master_datadir }}" +- "{{ standby_datadir }}" +- "{{ standby_logdir }}" +- "{{ default_logdir }}" +- "{{ mysql_safe_err_log }}" +- "{{ default_datadir }}" diff --git a/test/integration/targets/setup_mariadb/handlers/main.yml b/test/integration/targets/setup_mariadb/handlers/main.yml index 584fd28817a..7be5af507c1 100644 --- a/test/integration/targets/setup_mariadb/handlers/main.yml +++ b/test/integration/targets/setup_mariadb/handlers/main.yml @@ -6,19 +6,13 @@ - name: Remove MariaDB related packages yum: - name: "{{ item }}" + name: "{{ packages_to_cleanup }}" state: absent - loop: "{{ packages_to_cleanup }}" listen: cleanup mariadb - name: Remove related FS objects file: state: absent path: "{{ item }}" - loop: - - "{{ master_datadir }}" - - "{{ standby_datadir }}" - - "{{ standby_logdir }}" - - "{{ default_logdir }}" - - "{{ mysql_safe_err_log }}" + loop: "{{ fs_objects_to_clean_up }}" listen: cleanup mariadb diff --git a/test/integration/targets/setup_mariadb/tasks/setup_mariadb.yml b/test/integration/targets/setup_mariadb/tasks/setup_mariadb.yml index 845c46bc8c1..6301e9de057 100644 --- a/test/integration/targets/setup_mariadb/tasks/setup_mariadb.yml +++ b/test/integration/targets/setup_mariadb/tasks/setup_mariadb.yml @@ -12,9 +12,8 @@ - name: Install MariaDB packages on RedHat family OS yum: - name: "{{ item }}" + name: "{{ mariadb_packages }}" enablerepo: epel - loop: "{{ mariadb_packages }}" when: ansible_os_family == 'RedHat' notify: cleanup mariadb