Selaa lähdekoodia

fix conditionals to make ansible 2.19 happy, tweak deploy-rhbk a bit

Grega Bremec 2 päivää sitten
vanhempi
commit
3fddd6ab15

+ 1 - 1
p0f/operators/roles/deploy-local-storage/tasks/main.yml

@@ -124,7 +124,7 @@
     namespace: "{{ local_storage.namespace }}"
     name: "{{ local_storage.storage_class_name }}"
   register: lso_volset
-  until: (lso_volset.resources[0] | community.general.json_query('status.conditions[?type==`Available`].status'))
+  until: (lso_volset.resources[0] | community.general.json_query('status.conditions[?type==`Available`].status'))[0] == 'True'
   retries: 12
   delay: 5
 

+ 3 - 1
p0f/operators/roles/deploy-odf-storage/tasks/main.yml

@@ -151,7 +151,9 @@
     namespace: "{{ odf_storage.namespace }}"
     name: "{{ odf_storage.name }}-cephcluster"
   register: cephcluster
-  until: cephcluster.resources[0].status.phase == "Ready"
+  until:
+    - cephcluster.resources | length > 0
+    - cephcluster.resources[0].status.phase == "Ready"
   retries: 60
   delay: 5
 

+ 16 - 1
p0f/operators/roles/deploy-rhbk/tasks/present.yml

@@ -261,7 +261,7 @@
     - rhbk_ready.resources is defined
     - rhbk_ready.resources | length == 1
     - rhbk_ready.resources[0].status is defined
-    - (rhbk_ready.resources[0].status | community.general.json_query('conditions[?type==`Ready`].status'))[0]
+    - (rhbk_ready.resources[0].status | community.general.json_query('conditions[?type==`Ready`].status'))[0] == 'True'
   retries: 24
   delay: 5
 
@@ -299,6 +299,16 @@
   ansible.builtin.set_fact:
     realms: "{{ rhbk_realms.json | items2dict(key_name='realm', value_name='id') }}"
 
+- name: Show what groups were found at verbosity 2+.
+  ansible.builtin.debug:
+    var: admin_token
+    verbosity: 2
+
+- name: Show what groups were found at verbosity 2+.
+  ansible.builtin.debug:
+    var: realms
+    verbosity: 2
+
 - name: Import the realm if not present yet
   block:
 
@@ -366,6 +376,11 @@
       delay: 5
       when: created_import.changed
 
+    - name: Add another 30 seconds because Keycloak flaps.
+      ansible.builtin.pause:
+        prompt: Waiting 30 seconds for Keycloak to settle.
+        seconds: 30
+
   when:
     - realms[rhbk.realm | default('sample-realm')] is not defined
 

+ 5 - 0
p0f/operators/roles/deploy-rhbk/tasks/token.yml

@@ -23,6 +23,11 @@
     fail_msg: "ERROR: Failed to obtain authentication token from Keycloak."
     success_msg: "OK: got authentication token."
 
+- name: Show the token at verbosity 2+
+  debug:
+    verbosity: 2
+    var: sso_token_rsp.json.access_token
+
 - name: Store the token as a fact
   ansible.builtin.set_fact:
     admin_token: "{{ sso_token_rsp.json.access_token }}"