main.yml 943 B

123456789101112131415161718192021222324252627282930
  1. ---
  2. - name: Verify Ansible version is greater than 1.8.0 and not 1.9.0 and not 1.9.0.1
  3. assert:
  4. that:
  5. - ansible_version | version_compare('1.8.0', 'ge')
  6. - ansible_version | version_compare('1.9.0', 'ne')
  7. - ansible_version | version_compare('1.9.0.1', 'ne')
  8. - name: Detecting Operating System
  9. shell: ls /run/ostree-booted
  10. ignore_errors: yes
  11. failed_when: false
  12. changed_when: false
  13. register: ostree_output
  14. # Locally setup containerized facts for now
  15. - set_fact:
  16. l_is_atomic: "{{ ostree_output.rc == 0 }}"
  17. - set_fact:
  18. l_is_containerized: "{{ l_is_atomic or containerized | default(false) | bool }}"
  19. - name: Ensure PyYaml is installed
  20. action: "{{ ansible_pkg_mgr }} name=PyYAML state=present"
  21. when: not l_is_atomic | bool
  22. - name: Gather Cluster facts and set is_containerized if needed
  23. openshift_facts:
  24. role: common
  25. local_facts:
  26. is_containerized: "{{ containerized | default(None) }}"