Skip to content
Snippets Groups Projects
Commit 5c7eef70 authored by Egor's avatar Egor Committed by k8s-ci-robot
Browse files

Fix kube-router annotations: add conditions (#3670)

parent c2710899
No related branches found
No related tags found
No related merge requests found
...@@ -4,18 +4,18 @@ ...@@ -4,18 +4,18 @@
with_items: with_items:
- "{{ kube_router_annotations_master }}" - "{{ kube_router_annotations_master }}"
delegate_to: "{{groups['kube-master'][0]}}" delegate_to: "{{groups['kube-master'][0]}}"
when: kube_router_annotations_master is defined when: kube_router_annotations_master is defined and inventory_hostname in groups['kube-master']
- name: kube-router | Add annotations on kube-node - name: kube-router | Add annotations on kube-node
command: "{{bin_dir}}/kubectl annotate --overwrite node {{ ansible_hostname }} {{ item }}" command: "{{bin_dir}}/kubectl annotate --overwrite node {{ ansible_hostname }} {{ item }}"
with_items: with_items:
- "{{ kube_router_annotations_node }}" - "{{ kube_router_annotations_node }}"
delegate_to: "{{groups['kube-master'][0]}}" delegate_to: "{{groups['kube-master'][0]}}"
when: kube_router_annotations_node is defined when: kube_router_annotations_node is defined and inventory_hostname in groups['kube-node']
- name: kube-router | Add common annotations on all servers - name: kube-router | Add common annotations on all servers
command: "{{bin_dir}}/kubectl annotate --overwrite node {{ ansible_hostname }} {{ item }}" command: "{{bin_dir}}/kubectl annotate --overwrite node {{ ansible_hostname }} {{ item }}"
with_items: with_items:
- "{{ kube_router_annotations_all }}" - "{{ kube_router_annotations_all }}"
delegate_to: "{{groups['kube-master'][0]}}" delegate_to: "{{groups['kube-master'][0]}}"
when: kube_router_annotations_all is defined when: kube_router_annotations_all is defined and inventory_hostname in groups['all']
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment