prerequisites.yml 968 B

12345678910111213141516171819202122232425262728293031323334353637
  1. ---
  2. - name: "Cleaning yum repositories"
  3. command: "yum clean all"
  4. - name: "Install required packages"
  5. yum:
  6. name: "{{ item }}"
  7. state: latest
  8. with_items: "{{ required_packages }}"
  9. when: manage_packages|bool
  10. - name: "Install debug packages (optional)"
  11. yum:
  12. name: "{{ item }}"
  13. state: latest
  14. with_items: "{{ debug_packages }}"
  15. when: install_debug_packages|bool
  16. - name: "Update all packages (this can take a very long time)"
  17. yum:
  18. name: '*'
  19. state: latest
  20. when: manage_packages|bool
  21. - name: "Verify hostname"
  22. shell: hostnamectl status | awk "/Static hostname/"'{ print $3 }'
  23. register: hostname_fqdn
  24. - name: "Set hostname if required"
  25. hostname:
  26. name: "{{ ansible_fqdn }}"
  27. when: hostname_fqdn.stdout != ansible_fqdn
  28. - name: "Verify SELinux is enforcing"
  29. fail:
  30. msg: "SELinux is required for OpenShift and has been detected as '{{ ansible_selinux.config_mode }}'"
  31. when: ansible_selinux.config_mode != "enforcing"