main.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ---
  2. - name: Set node sdn OpenShift facts
  3. openshift_facts:
  4. role: 'node_sdn'
  5. local_facts:
  6. debug_level: "{{ openshift_node_sdn_debug_level | default(openshift.common.debug_level) }}"
  7. - name: Install openshift-sdn-node
  8. yum:
  9. pkg: openshift-sdn-node
  10. state: installed
  11. register: install_result
  12. - name: Reload systemd units
  13. command: systemctl daemon-reload
  14. when: install_result | changed
  15. # TODO: we are specifying -hostname= for OPTIONS as a workaround for
  16. # openshift-sdn-node not properly detecting the hostname.
  17. # TODO: we should probably generate certs specifically for sdn
  18. - name: Configure openshift-sdn-node settings
  19. lineinfile:
  20. dest: /etc/sysconfig/openshift-sdn-node
  21. regexp: "{{ item.regex }}"
  22. line: "{{ item.line }}"
  23. backrefs: yes
  24. with_items:
  25. - regex: '^(OPTIONS=)'
  26. line: '\1"-v={{ openshift.node_sdn.debug_level }} -hostname={{ openshift.common.hostname }}
  27. -etcd-cafile={{ openshift_node_cert_dir }}/ca.crt
  28. -etcd-certfile={{ openshift_node_cert_dir }}/master-client.crt
  29. -etcd-keyfile={{ openshift_node_cert_dir }}/master-client.key\"'
  30. - regex: '^(MASTER_URL=)'
  31. line: '\1"{{ openshift_sdn_master_url }}"'
  32. - regex: '^(MINION_IP=)'
  33. line: '\1"{{ openshift.common.ip }}"'
  34. notify: restart openshift-sdn-node
  35. - name: Ensure we aren't setting DOCKER_OPTIONS in /etc/sysconfig/openshift-sdn-node
  36. lineinfile:
  37. dest: /etc/sysconfig/openshift-sdn-node
  38. regexp: '^DOCKER_OPTIONS='
  39. state: absent
  40. notify: restart openshift-sdn-node
  41. # TODO lock down the insecure-registry config to a more sane value than
  42. # 0.0.0.0/0
  43. - name: Configure docker insecure-registry setting
  44. lineinfile:
  45. dest: /etc/sysconfig/docker
  46. regexp: INSECURE_REGISTRY=
  47. line: INSECURE_REGISTRY='--insecure-registry=0.0.0.0/0'
  48. notify: restart openshift-sdn-node
  49. - name: Start and enable openshift-sdn-node
  50. service:
  51. name: openshift-sdn-node
  52. enabled: yes
  53. state: started