2018-10-21 15:35:52 +08:00
|
|
|
---
|
|
|
|
- name: kube-router | Add annotations on kube-master
|
2019-05-03 05:24:21 +08:00
|
|
|
command: "{{ bin_dir }}/kubectl annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
2018-10-21 15:35:52 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ kube_router_annotations_master }}"
|
2019-05-03 05:24:21 +08:00
|
|
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
2018-11-10 00:15:27 +08:00
|
|
|
when: kube_router_annotations_master is defined and inventory_hostname in groups['kube-master']
|
2018-10-21 15:35:52 +08:00
|
|
|
|
|
|
|
- name: kube-router | Add annotations on kube-node
|
2019-05-03 05:24:21 +08:00
|
|
|
command: "{{ bin_dir }}/kubectl annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
2018-10-21 15:35:52 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ kube_router_annotations_node }}"
|
2019-05-03 05:24:21 +08:00
|
|
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
2018-11-10 00:15:27 +08:00
|
|
|
when: kube_router_annotations_node is defined and inventory_hostname in groups['kube-node']
|
2018-10-21 15:35:52 +08:00
|
|
|
|
|
|
|
- name: kube-router | Add common annotations on all servers
|
2019-05-03 05:24:21 +08:00
|
|
|
command: "{{ bin_dir }}/kubectl annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
2018-10-21 15:35:52 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ kube_router_annotations_all }}"
|
2019-05-03 05:24:21 +08:00
|
|
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
2019-08-19 19:53:29 +08:00
|
|
|
when: kube_router_annotations_all is defined and inventory_hostname in groups['k8s-cluster']
|