From d874da0cb352f3b4ade9f833cff738a085032aa1 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Thu, 2 Feb 2023 21:52:57 +0100 Subject: [PATCH] Prevent configuration reset;Fix query --- .../ansible_payload/upgrade/roles/metacluster/tasks/k3s.yml | 3 ++- .../upgrade/roles/metacluster/tasks/storage.yml | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/k3s.yml b/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/k3s.yml index b5147dd..4a6bb5a 100644 --- a/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/k3s.yml +++ b/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/k3s.yml @@ -27,7 +27,8 @@ chdir: /opt/metacluster/k3s environment: INSTALL_K3S_SKIP_DOWNLOAD: 'true' - INSTALL_K3S_EXEC: "server --token {{ vapp['metacluster.token'] | trim }} --server https://{{ vapp['metacluster.vip'] }}:6443 --disable local-storage --config /etc/rancher/k3s/config.yaml" + # To prevent from overwriting traefik's existing configuration, "disable" it on this new node + INSTALL_K3S_EXEC: "server --token {{ vapp['metacluster.token'] | trim }} --server https://{{ vapp['metacluster.vip'] }}:6443 --disable local-storage,traefik --config /etc/rancher/k3s/config.yaml" when: ansible_facts.services['k3s.service'] is undefined - name: Ensure API availability diff --git a/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/storage.yml b/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/storage.yml index b5880c7..cb0c321 100644 --- a/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/storage.yml +++ b/ansible/roles/firstboot/files/ansible_payload/upgrade/roles/metacluster/tasks/storage.yml @@ -21,9 +21,9 @@ method: GET register: volume_details until: - - volume_details.json.data is defined - - (volume_details.json.data | json_query('[*].robustness') | unique | length) == 1 - - (volume_details.json.data | json_query('[*].robustness') | first) == "healthy" + - volume_details.json is defined + - (volume_details.json | json_query('data[? state==`attached`].robustness') | unique | length) == 1 + - (volume_details.json | json_query('data[? state==`attached`].robustness') | first) == "healthy" retries: "{{ playbook.retries }}" delay: "{{ playbook.delay.long }}"