Explorar el Código

typos, improved conditions, acs version bump

Grega Bremec hace 3 años
padre
commit
f7b62dbed8
Se han modificado 3 ficheros con 6 adiciones y 6 borrados
  1. 0 1
      deploy-central.yml
  2. 2 1
      inventory
  3. 4 4
      roles/deploy-central/tasks/main.yml

+ 0 - 1
deploy-central.yml

@@ -1,4 +1,3 @@
-
 ---
 - name: Make sure central is deployed
   hosts: workstation.lab.example.com

+ 2 - 1
inventory

@@ -7,7 +7,8 @@ bastion.lab.example.com ansible_user=root
 ocp_maj = "4.10"
 ocp_z = "4.10.4"
 rhcos_ver = "4.10.3"
-acs_maj = 3.69
+acs_maj = "3.69"
+acs_z = "3.69.1"
 cinst_ver = latest
 butane_ver = latest
 

+ 4 - 4
roles/deploy-central/tasks/main.yml

@@ -31,7 +31,7 @@
 - name: reset the above fact if not the case
   set_fact:
     csv_is_there: false
-  when: (csv is not defined) or (csv.resources | length == 0) or (csv.resources[0].status.phase != "Succeeded")
+  when: (csv is not defined) or (csv.resources is not defined) or (csv.resources | length == 0) or (csv.resources[0].status.phase != "Succeeded")
 
 - name: is there a central pod?
   k8s_info:
@@ -51,7 +51,7 @@
 - name: reset the above fact if not the case
   set_fact:
     central_is_there: false
-  when: (central is not defined) or (central.resources | length == 0) or (central.resources[0].status.phase != "Running")
+  when: (central is not defined) or (central.resources is not defined) or (central.resources | length == 0) or (central.resources[0].status.phase != "Running")
 
 #- name: is there anyone home at the api endpoint?
 
@@ -152,7 +152,7 @@
     force_basic_auth: true
     return_content: true
     validate_certs: false
-    url: "https://{{ central_ep }}/v1/apitokens"
+    url: "https://{{ central_ep }}/v1/apitokens?revoked=false"
     url_username: admin
     url_password: "{{ central_pass | string | b64decode }}"
     headers:
@@ -180,7 +180,7 @@
   copy:
     dest: "{{ ansible_facts['user_dir'] }}/api-token"
     content: "{{ api_token.json.token }}"
-  when: not api_token.skipped
+  when: (api_token.skipped is not defined) or (not api_token.skipped)
 
 #- name: take a policy backup (for later)
 ## XXX can't delete system policies XXX