main.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ---
  2. - fail:
  3. msg: "SELinux is disabled, This deployment type requires that SELinux is enabled."
  4. when:
  5. - (not ansible_selinux or ansible_selinux.status != 'enabled')
  6. - openshift_deployment_type == 'openshift-enterprise'
  7. - not openshift_use_crio | bool
  8. - import_tasks: dnsmasq_install.yml
  9. - import_tasks: dnsmasq.yml
  10. - name: setup firewall
  11. import_tasks: firewall.yml
  12. - name: Restart cri-o
  13. systemd:
  14. name: cri-o
  15. enabled: yes
  16. state: restarted
  17. when: openshift_use_crio | bool
  18. register: task_result
  19. failed_when:
  20. - task_result is failed
  21. - ('could not find the requested service' not in task_result.msg|lower)
  22. - name: restart NetworkManager to ensure resolv.conf is present
  23. systemd:
  24. name: NetworkManager
  25. enabled: yes
  26. state: restarted
  27. - name: Start node image prepull
  28. import_tasks: prepull.yml
  29. - name: include node installer
  30. import_tasks: install.yml
  31. - name: Update journald config
  32. import_tasks: journald.yml
  33. #### Disable SWAP #####
  34. # https://docs.openshift.com/container-platform/3.4/admin_guide/overcommit.html#disabling-swap-memory
  35. # swapoff is a custom module in lib_utils that comments out swap entries in
  36. # /etc/fstab and runs swapoff -a, if necessary.
  37. - name: Disable swap
  38. swapoff: {}
  39. when: openshift_disable_swap | default(true) | bool
  40. # The atomic-openshift-node service will set this parameter on
  41. # startup, but if the network service is restarted this setting is
  42. # lost. Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1372388
  43. - sysctl:
  44. name: net.ipv4.ip_forward
  45. value: 1
  46. sysctl_file: "/etc/sysctl.d/99-openshift.conf"
  47. reload: yes
  48. - import_tasks: selinux_container_cgroup.yml
  49. - import_tasks: registry_auth.yml
  50. - import_tasks: prepull_check.yml
  51. - name: include standard node config
  52. import_tasks: config.yml
  53. #### Storage class plugins here ####
  54. - name: NFS storage plugin configuration
  55. import_tasks: storage_plugins/nfs.yml
  56. - name: GlusterFS storage plugin configuration
  57. import_tasks: glusterfs.yml
  58. when: "'glusterfs' in osn_storage_plugin_deps"
  59. - name: Ceph storage plugin configuration
  60. import_tasks: storage_plugins/ceph.yml
  61. when: "'ceph' in osn_storage_plugin_deps"
  62. - name: iSCSI storage plugin configuration
  63. import_tasks: storage_plugins/iscsi.yml
  64. when: "'iscsi' in osn_storage_plugin_deps"
  65. ##### END Storage #####