From 84e95d25a0d8a0c5e0fb68e877744ac26549c0b4 Mon Sep 17 00:00:00 2001 From: Michal Arbet Date: Thu, 23 May 2024 18:24:10 +0200 Subject: [PATCH] Fix mariadb recovery This patch modifies tasks that are delegated to localhost to use local connection. Firstly, this is correct since SSH connection is not used, and secondly, it fixes the issue when kolla-ansible is packaged in a docker container. If the local connection is not used, the tasks will fail because temporary data are stored outside the container, whereas we need it to be stored inside the container so we can read them and set_facts. Closes-Bug: #2073370 Change-Id: I9547d5da78da30bfeea8e97056cfa9308c977098 --- ansible/roles/mariadb/tasks/recover_cluster.yml | 3 +++ releasenotes/notes/bug-2073370-268e9a76be9f2ae9.yaml | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 releasenotes/notes/bug-2073370-268e9a76be9f2ae9.yaml diff --git a/ansible/roles/mariadb/tasks/recover_cluster.yml b/ansible/roles/mariadb/tasks/recover_cluster.yml index 88324d54b5..e62a82fc17 100644 --- a/ansible/roles/mariadb/tasks/recover_cluster.yml +++ b/ansible/roles/mariadb/tasks/recover_cluster.yml @@ -9,6 +9,7 @@ path: "{{ item }}" state: absent delegate_to: localhost + connection: local changed_when: false check_mode: no run_once: true @@ -83,10 +84,12 @@ dest: "{{ mariadb_recover_tmp_file_path }}" mode: 0644 delegate_to: localhost + connection: local changed_when: false when: seqno_compare.results | map(attribute='stdout') | join('') == "" - name: Registering mariadb_recover_inventory_name from temp file + connection: local set_fact: mariadb_recover_inventory_name: "{{ lookup('file', mariadb_recover_tmp_file_path) }}" when: diff --git a/releasenotes/notes/bug-2073370-268e9a76be9f2ae9.yaml b/releasenotes/notes/bug-2073370-268e9a76be9f2ae9.yaml new file mode 100644 index 0000000000..d15c65fd1a --- /dev/null +++ b/releasenotes/notes/bug-2073370-268e9a76be9f2ae9.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes the MariaDB recovery issue when kolla-ansible is running from + a docker container. `LP#2073370 `__