Selaa lähdekoodia

properly checking conditions

Grega Bremec 3 vuotta sitten
vanhempi
commit
039b921b3c
1 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 6 2
      roles/fix-policies/tasks/main.yml

+ 6 - 2
roles/fix-policies/tasks/main.yml

@@ -76,13 +76,17 @@
   file:
     path: "{{ ansible_facts['user_dir'] }}/roxctl-token"
     state: absent
-  when: symlink_token is defined
+  when:
+    - symlink_token is defined
+    - not symlink_token.skipped
 
 - name: Clean up policy symlink
   file:
     path: "{{ ansible_facts['user_dir'] }}/policyexport"
     state: absent
-  when: symlink_policies is defined
+  when:
+    - symlink_policies is defined
+    - not symlink_policies.skipped
 
 # Get a list of policies:
 # curl -ks -H "Authorization: Bearer $(cat roxctl-token)" -XGET https://central-rhacs.apps.ocp4.example.com/v1/policies | jq -r '[ .policies[].id ]'