main.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. - name: Determine if CoreOS
  3. raw: "grep '^NAME=' /etc/os-release | sed s'/NAME=//'"
  4. register: distro
  5. check_mode: no
  6. - name: Init the contiv_is_coreos fact
  7. set_fact:
  8. contiv_is_coreos: false
  9. - name: Set the contiv_is_coreos fact
  10. set_fact:
  11. contiv_is_coreos: true
  12. when: "'CoreOS' in distro.stdout"
  13. - name: Set the bin directory path for CoreOS
  14. set_fact:
  15. contiv_bin_dir: "/opt/bin"
  16. when: contiv_is_coreos
  17. - name: Create the directory used to store binaries
  18. file:
  19. path: "{{ contiv_bin_dir }}"
  20. state: directory
  21. - name: Create Ansible temp directory
  22. file:
  23. path: "{{ contiv_ansible_temp_dir }}"
  24. state: directory
  25. - name: Determine if has rpm
  26. stat:
  27. path: /usr/bin/rpm
  28. get_checksum: false
  29. get_attributes: false
  30. get_mime: false
  31. register: s
  32. changed_when: false
  33. check_mode: no
  34. - name: Init the contiv_has_rpm fact
  35. set_fact:
  36. contiv_has_rpm: false
  37. - name: Set the contiv_has_rpm fact
  38. set_fact:
  39. contiv_has_rpm: true
  40. when: s.stat.exists
  41. - name: Init the contiv_has_firewalld fact
  42. set_fact:
  43. contiv_has_firewalld: false
  44. - name: Init the contiv_has_iptables fact
  45. set_fact:
  46. contiv_has_iptables: false
  47. # collect information about what packages are installed
  48. - include_tasks: rpm.yml
  49. when: contiv_has_rpm
  50. - include_tasks: fedora-install.yml
  51. when: not openshift_is_atomic and ansible_distribution == "Fedora"