main.yml 1.1 KB

123456789101112131415161718192021222324252627282930
  1. ---
  2. # tasks file for openshift_minion
  3. - name: Install OpenShift
  4. yum: pkg=origin state=installed
  5. - name: Configure OpenShift settings
  6. lineinfile: >
  7. dest=/etc/sysconfig/openshift
  8. regexp={{ item.regex }}
  9. line="{{ item.line }}"
  10. with_items:
  11. - { regex: '^OPENSHIFT_MASTER', line: 'OPENSHIFT_MASTER=\"{{ oo_master_ips[0] }}\"' }
  12. - { regex: '^OPENSHIFT_BIND_ADDR', line: 'OPENSHIFT_BIND_ADDR=\"{{ oo_bind_ip }}\"'}
  13. notify:
  14. - restart openshift-minion
  15. - name: Open firewalld port for OpenShift
  16. firewalld: port=10250/tcp permanent=false state=enabled
  17. - name: Save firewalld port for OpenShift
  18. firewalld: port=10250/tcp permanent=true state=enabled
  19. # POST ${master_ip}:8080/api/v1beta1/minions kind=Minion id=${node_ip} apiVersion=v1beta1 hostIP=${node_ip} >/dev/null
  20. - name: Enable OpenShift
  21. service: name=openshift enabled=yes state=started
  22. - name: Register with OpenShift master
  23. command: "curl -X POST -H 'Accept: application/json' -d '{\"kind\":\"Minion\", \"id\":\"{{ oo_bind_ip }}\", \"apiVersion\":\"v1beta1\", \"hostIP\":\"{{ oo_bind_ip }}\" }' http://{{ oo_master_ips[0] }}:8080/api/v1beta1/minions"
  24. when: oo_master_ips[0] != ''