main.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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: path=/usr/bin/rpm
  27. register: s
  28. changed_when: false
  29. check_mode: no
  30. - name: Init the contiv_has_rpm fact
  31. set_fact:
  32. contiv_has_rpm: false
  33. - name: Set the contiv_has_rpm fact
  34. set_fact:
  35. contiv_has_rpm: true
  36. when: s.stat.exists
  37. - name: Init the contiv_has_firewalld fact
  38. set_fact:
  39. contiv_has_firewalld: false
  40. - name: Init the contiv_has_iptables fact
  41. set_fact:
  42. contiv_has_iptables: false
  43. # collect information about what packages are installed
  44. - include_tasks: rpm.yml
  45. when: contiv_has_rpm
  46. - include_tasks: fedora-install.yml
  47. when: not openshift_is_atomic and ansible_distribution == "Fedora"