2018-10-21 15:35:52 +08:00
|
|
|
---
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Kube-router | Add annotations on kube_control_plane
|
2022-01-05 18:26:32 +08:00
|
|
|
command: "{{ kubectl }} annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
2018-10-21 15:35:52 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ kube_router_annotations_master }}"
|
2021-03-24 08:26:05 +08:00
|
|
|
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
|
|
|
when: kube_router_annotations_master is defined and inventory_hostname in groups['kube_control_plane']
|
2018-10-21 15:35:52 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Kube-router | Add annotations on kube_node
|
2022-01-05 18:26:32 +08:00
|
|
|
command: "{{ kubectl }} annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
2018-10-21 15:35:52 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ kube_router_annotations_node }}"
|
2021-03-24 08:26:05 +08:00
|
|
|
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
2021-04-29 20:20:50 +08:00
|
|
|
when: kube_router_annotations_node is defined and inventory_hostname in groups['kube_node']
|
2018-10-21 15:35:52 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Kube-router | Add common annotations on all servers
|
2022-01-05 18:26:32 +08:00
|
|
|
command: "{{ kubectl }} annotate --overwrite node {{ ansible_hostname }} {{ item }}"
|
2018-10-21 15:35:52 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ kube_router_annotations_all }}"
|
2021-03-24 08:26:05 +08:00
|
|
|
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
2021-04-29 20:20:50 +08:00
|
|
|
when: kube_router_annotations_all is defined and inventory_hostname in groups['k8s_cluster']
|