main.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. ---
  2. - name: Detecting Atomic Host Operating System
  3. stat:
  4. path: /run/ostree-booted
  5. register: ostree_booted
  6. - block:
  7. - name: Debug r_openshift_excluder_enable_docker_excluder
  8. debug:
  9. var: r_openshift_excluder_enable_docker_excluder
  10. - name: Debug r_openshift_excluder_enable_openshift_excluder
  11. debug:
  12. var: r_openshift_excluder_enable_openshift_excluder
  13. - name: Fail if invalid openshift_excluder_action provided
  14. fail:
  15. msg: "openshift_excluder role can only be called with 'enable' or 'disable'"
  16. when: r_openshift_excluder_action not in ['enable', 'disable']
  17. - name: Fail if r_openshift_excluder_upgrade_target is not defined
  18. fail:
  19. msg: "r_openshift_excluder_upgrade_target must be provided when using this role for upgrades"
  20. when:
  21. - r_openshift_excluder_verify_upgrade | bool
  22. - r_openshift_excluder_upgrade_target is not defined
  23. - name: Include main action task file
  24. include_tasks: "{{ r_openshift_excluder_action }}.yml"
  25. when:
  26. - not ostree_booted.stat.exists | bool