2017-08-24 09:09:52 +00:00
|
|
|
---
|
2017-09-09 20:38:38 +00:00
|
|
|
|
|
|
|
- name: Kubernetes Apps | Check if netchecker-server manifest already exists
|
|
|
|
stat:
|
|
|
|
path: "{{ kube_config_dir }}/netchecker-server-deployment.yml.j2"
|
|
|
|
register: netchecker_server_manifest
|
|
|
|
tags: ['facts', 'upgrade']
|
|
|
|
|
|
|
|
- name: Kubernetes Apps | Apply netchecker-server manifest to update annotations
|
|
|
|
kube:
|
|
|
|
name: "netchecker-server"
|
|
|
|
namespace: "{{ netcheck_namespace }}"
|
|
|
|
kubectl: "{{bin_dir}}/kubectl"
|
|
|
|
resource: "deploy"
|
|
|
|
state: latest
|
|
|
|
when: inventory_hostname == groups['kube-master'][0] and netchecker_server_manifest.stat.exists
|
|
|
|
tags: upgrade
|
|
|
|
|
2016-09-30 15:23:47 +00:00
|
|
|
- name: Kubernetes Apps | Lay Down Netchecker Template
|
2017-02-17 21:22:34 +00:00
|
|
|
template:
|
|
|
|
src: "{{item.file}}"
|
|
|
|
dest: "{{kube_config_dir}}/{{item.file}}"
|
2016-09-30 15:23:47 +00:00
|
|
|
with_items:
|
2017-03-28 14:33:07 +00:00
|
|
|
- {file: netchecker-agent-ds.yml.j2, type: ds, name: netchecker-agent}
|
|
|
|
- {file: netchecker-agent-hostnet-ds.yml.j2, type: ds, name: netchecker-agent-hostnet}
|
2017-07-17 11:28:09 +00:00
|
|
|
- {file: netchecker-server-sa.yml.j2, type: sa, name: netchecker-server}
|
|
|
|
- {file: netchecker-server-clusterrole.yml.j2, type: clusterrole, name: netchecker-server}
|
|
|
|
- {file: netchecker-server-clusterrolebinding.yml.j2, type: clusterrolebinding, name: netchecker-server}
|
2017-08-14 15:43:56 +00:00
|
|
|
- {file: netchecker-server-deployment.yml.j2, type: deployment, name: netchecker-server}
|
2017-03-28 14:33:07 +00:00
|
|
|
- {file: netchecker-server-svc.yml.j2, type: svc, name: netchecker-service}
|
2016-09-30 15:23:47 +00:00
|
|
|
register: manifests
|
2017-07-17 11:28:09 +00:00
|
|
|
when:
|
|
|
|
- inventory_hostname == groups['kube-master'][0]
|
|
|
|
- rbac_enabled or item.type not in rbac_resources
|
2016-09-30 15:23:47 +00:00
|
|
|
|
2017-08-18 12:46:22 +00:00
|
|
|
- name: Kubernetes Apps | Purge old Netchecker server
|
|
|
|
kube:
|
|
|
|
name: "netchecker-server"
|
|
|
|
namespace: "{{ netcheck_namespace }}"
|
|
|
|
kubectl: "{{bin_dir}}/kubectl"
|
|
|
|
resource: "po"
|
|
|
|
state: absent
|
|
|
|
when: inventory_hostname == groups['kube-master'][0]
|
|
|
|
|
2016-09-30 15:23:47 +00:00
|
|
|
- name: Kubernetes Apps | Start Netchecker Resources
|
|
|
|
kube:
|
|
|
|
name: "{{item.item.name}}"
|
|
|
|
namespace: "{{netcheck_namespace}}"
|
|
|
|
kubectl: "{{bin_dir}}/kubectl"
|
|
|
|
resource: "{{item.item.type}}"
|
|
|
|
filename: "{{kube_config_dir}}/{{item.item.file}}"
|
2017-09-05 05:23:12 +00:00
|
|
|
state: "latest"
|
2016-09-30 15:23:47 +00:00
|
|
|
with_items: "{{ manifests.results }}"
|
2017-09-05 05:23:12 +00:00
|
|
|
when: inventory_hostname == groups['kube-master'][0] and not item|skipped
|