You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.4 KiB

  1. - name: Kubernetes Apps | Lay Down Netchecker Template
  2. template: src={{item.file}} dest={{kube_config_dir}}/{{item.file}}
  3. with_items:
  4. - {file: netchecker-agent-ds.yml, type: ds, name: netchecker-agent}
  5. - {file: netchecker-agent-hostnet-ds.yml, type: ds, name: netchecker-agent-hostnet}
  6. - {file: netchecker-server-pod.yml, type: po, name: netchecker-server}
  7. - {file: netchecker-server-svc.yml, type: svc, name: netchecker-service}
  8. register: manifests
  9. when: inventory_hostname == groups['kube-master'][0]
  10. #FIXME: remove if kubernetes/features#124 is implemented
  11. - name: Kubernetes Apps | Purge old Netchecker daemonsets
  12. kube:
  13. name: "{{item.item.name}}"
  14. namespace: "{{netcheck_namespace}}"
  15. kubectl: "{{bin_dir}}/kubectl"
  16. resource: "{{item.item.type}}"
  17. filename: "{{kube_config_dir}}/{{item.item.file}}"
  18. state: absent
  19. with_items: "{{ manifests.results }}"
  20. when: inventory_hostname == groups['kube-master'][0] and item.item.type == "ds" and item.changed
  21. - name: Kubernetes Apps | Start Netchecker Resources
  22. kube:
  23. name: "{{item.item.name}}"
  24. namespace: "{{netcheck_namespace}}"
  25. kubectl: "{{bin_dir}}/kubectl"
  26. resource: "{{item.item.type}}"
  27. filename: "{{kube_config_dir}}/{{item.item.file}}"
  28. state: "{{item.changed | ternary('latest','present') }}"
  29. with_items: "{{ manifests.results }}"
  30. when: inventory_hostname == groups['kube-master'][0]