main.yml 2.2 KB

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