main.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. # TODO: allow for overriding default ports where possible
  3. - name: Set node OpenShift facts
  4. openshift_facts:
  5. role: "{{ item.role }}"
  6. local_facts: "{{ item.local_facts }}"
  7. with_items:
  8. - role: common
  9. local_facts:
  10. hostname: "{{ openshift_hostname | default(none) }}"
  11. public_hostname: "{{ openshift_public_hostname | default(none) }}"
  12. deployment_type: "{{ openshift_deployment_type }}"
  13. - role: node
  14. local_facts:
  15. resources_cpu: "{{ openshift_node_resources_cpu | default(none) }}"
  16. resources_memory: "{{ openshift_node_resources_memory | default(none) }}"
  17. pod_cidr: "{{ openshift_node_pod_cidr | default(none) }}"
  18. labels: "{{ openshift_node_labels | default(none) }}"
  19. annotations: "{{ openshift_node_annotations | default(none) }}"
  20. registry_url: "{{ oreg_url | default(none) }}"
  21. debug_level: "{{ openshift_node_debug_level | default(openshift.common.debug_level) }}"
  22. - name: Install OpenShift Node package
  23. yum: pkg=openshift-node state=installed
  24. register: node_install_result
  25. - name: Install openshift-sdn-ovs
  26. yum: pkg=openshift-sdn-ovs state=installed
  27. register: sdn_install_result
  28. when: openshift.common.use_openshift_sdn
  29. - name: Reload systemd units
  30. command: systemctl daemon-reload
  31. when: (node_install_result | changed or (openshift.common.use_openshift_sdn
  32. and sdn_install_result | changed))
  33. # TODO: add the validate parameter when there is a validation command to run
  34. - name: Create the Node config
  35. template:
  36. dest: "{{ openshift_node_config_file }}"
  37. src: node.yaml.v1.j2
  38. notify:
  39. - restart openshift-node
  40. - name: Configure OpenShift Node settings
  41. lineinfile:
  42. dest: /etc/sysconfig/openshift-node
  43. regexp: "{{ item.regex }}"
  44. line: "{{ item.line }}"
  45. with_items:
  46. - regex: '^OPTIONS='
  47. line: "OPTIONS=--loglevel={{ openshift.node.debug_level }}"
  48. - regex: '^CONFIG_FILE='
  49. line: "CONFIG_FILE={{ openshift_node_config_file }}"
  50. notify:
  51. - restart openshift-node
  52. - name: Allow NFS access for VMs
  53. seboolean: name=virt_use_nfs state=yes persistent=yes
  54. - name: Start and enable openshift-node
  55. service: name=openshift-node enabled=yes state=started