config.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ---
  2. - name: get worker ignition file
  3. command: >
  4. curl -k {{ openshift_bootstrap_endpoint }}
  5. register: l_worker_bootstrap
  6. - debug:
  7. var: l_worker_bootstrap.stdout
  8. - name: parse ignition file
  9. parse_ignition:
  10. ign_file_contents: "{{ l_worker_bootstrap.stdout }}"
  11. register: l_parse_ignition_res
  12. - name: Create all the directories we will need
  13. command: "mkdir -p {{ item }}"
  14. with_items: "{{ l_parse_ignition_res.dir_list }}"
  15. - name: create files from ignition contents
  16. copy:
  17. content: "{{ item.value.contents }}"
  18. dest: "{{ item.key }}"
  19. mode: "{{ l_file_mode }}"
  20. with_dict: "{{ l_parse_ignition_res.files_dict }}"
  21. vars:
  22. l_mode_prepend: "{{ '0' if (item.value.mode | length < 4) else '' }}"
  23. l_file_mode: "{{ l_mode_prepend ~ item.value.mode }}"
  24. #### Disable SWAP #####
  25. # https://docs.openshift.com/container-platform/3.4/admin_guide/overcommit.html#disabling-swap-memory
  26. # swapoff is a custom module in lib_utils that comments out swap entries in
  27. # /etc/fstab and runs swapoff -a, if necessary.
  28. - name: Disable swap
  29. swapoff: {}
  30. when: openshift_disable_swap | default(true) | bool
  31. # The atomic-openshift-node service will set this parameter on
  32. # startup, but if the network service is restarted this setting is
  33. # lost. Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1372388
  34. - sysctl:
  35. name: net.ipv4.ip_forward
  36. value: 1
  37. sysctl_file: "/etc/sysctl.d/99-openshift.conf"
  38. reload: yes
  39. - name: Setting sebool container_manage_cgroup
  40. seboolean:
  41. name: container_manage_cgroup
  42. state: yes
  43. persistent: yes