diff --git a/ansible/roles/mariadb/tasks/recover_cluster.yml b/ansible/roles/mariadb/tasks/recover_cluster.yml index 15ec23a017..01123221c9 100644 --- a/ansible/roles/mariadb/tasks/recover_cluster.yml +++ b/ansible/roles/mariadb/tasks/recover_cluster.yml @@ -26,6 +26,7 @@ kolla_docker: name: "{{ mariadb_service.container_name }}" action: "stop_container" + ignore_missing: true # Run wsrep recovery with detach=false to block until completion. Use a # different container name to avoid the mariadb container being removed. @@ -47,7 +48,7 @@ - name: Copying MariaDB log file to /tmp become: true - command: "docker cp {{ mariadb_service.container_name }}:/var/log/kolla/mariadb/mariadb.log /tmp/mariadb_tmp.log" + command: "cp {{ docker_runtime_directory or '/var/lib/docker' }}/volumes/kolla_logs/_data/mariadb/mariadb.log /tmp/mariadb_tmp.log" # Look for sequence number in logs. Format is: # WSREP: Recovered position: :. @@ -100,18 +101,10 @@ set_fact: bootstrap_host: "{{ mariadb_recover_inventory_name }}" -- name: Copying grastate.dat file from MariaDB container in bootstrap host - become: true - command: "docker cp {{ mariadb_service.container_name }}:/var/lib/mysql/grastate.dat /tmp/kolla_mariadb_grastate.dat" - changed_when: false - when: - - bootstrap_host is defined - - bootstrap_host == inventory_hostname - - name: Set grastate.dat file from MariaDB container in bootstrap host become: true lineinfile: - dest: /tmp/kolla_mariadb_grastate.dat + dest: "{{ docker_runtime_directory or '/var/lib/docker' }}/volumes/mariadb/_data/grastate.dat" regexp: 'safe_to_bootstrap:(.*)$' line: 'safe_to_bootstrap: 1' state: present @@ -119,14 +112,6 @@ - bootstrap_host is defined - bootstrap_host == inventory_hostname -- name: Copying grastate.dat file to mariadb container - become: true - command: docker cp /tmp/kolla_mariadb_grastate.dat {{ mariadb_service.container_name }}:/var/lib/mysql/grastate.dat - changed_when: false - when: - - bootstrap_host is defined - - bootstrap_host == inventory_hostname - - name: Starting first MariaDB container become: true kolla_docker: diff --git a/releasenotes/notes/bug-1907658-a24ddc45f63893b5.yaml b/releasenotes/notes/bug-1907658-a24ddc45f63893b5.yaml new file mode 100644 index 0000000000..d92e6780a7 --- /dev/null +++ b/releasenotes/notes/bug-1907658-a24ddc45f63893b5.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue with ``kolla-ansible mariadb_recovery`` when the ``mariadb`` + container does not exist on one or more hosts. `LP#1907658 + `__