main.yml 762 B

12345678910111213141516171819202122232425
  1. ---
  2. # tasks file for kubernetes_apiserver
  3. - name: Install kubernetes
  4. yum: pkg=kubernetes
  5. - name: Configure apiserver settings
  6. lineinfile: >
  7. dest=/etc/sysconfig/kubernetes
  8. regexp={{ item.regex }}
  9. line="{{ item.line }}"
  10. with_items:
  11. - { regex: '^KUBE_API_MACHINES=', line: 'KUBE_API_MACHINES=\"{{ oo_minion_ips | join(",") }}\"' }
  12. - { regex: '^KUBE_API_ADDRESS=', line: 'KUBE_API_ADDRESS=\"0.0.0.0\"' }
  13. notify:
  14. - restart kubernetes-apiserver
  15. - name: Enable apiserver
  16. service: name=kubernetes-apiserver enabled=yes state=started
  17. - name: Open firewalld port for apiserver
  18. firewalld: port=8080/tcp permanent=false state=enabled
  19. - name: Save firewalld port for apiserver
  20. firewalld: port=8080/tcp permanent=true state=enabled