Replace injected Ansible fact variables in network_plugin role (#13382)

This commit is contained in:
Nikhil Kumar
2026-08-16 14:24:17 +00:00
committed by GitHub
parent ddd9ae131b
commit bf077e7360
8 changed files with 21 additions and 21 deletions
@@ -1,20 +1,20 @@
---
- name: Kube-router | Add annotations on kube_control_plane
command: "{{ kubectl }} annotate --overwrite node {{ ansible_hostname }} {{ item }}"
command: "{{ kubectl }} annotate --overwrite node {{ ansible_facts['hostname'] }} {{ item }}"
with_items:
- "{{ kube_router_annotations_master }}"
delegate_to: "{{ groups['kube_control_plane'][0] }}"
when: kube_router_annotations_master is defined and 'kube_control_plane' in group_names
- name: Kube-router | Add annotations on kube_node
command: "{{ kubectl }} annotate --overwrite node {{ ansible_hostname }} {{ item }}"
command: "{{ kubectl }} annotate --overwrite node {{ ansible_facts['hostname'] }} {{ item }}"
with_items:
- "{{ kube_router_annotations_node }}"
delegate_to: "{{ groups['kube_control_plane'][0] }}"
when: kube_router_annotations_node is defined and 'kube_node' in group_names
- name: Kube-router | Add common annotations on all servers
command: "{{ kubectl }} annotate --overwrite node {{ ansible_hostname }} {{ item }}"
command: "{{ kubectl }} annotate --overwrite node {{ ansible_facts['hostname'] }} {{ item }}"
with_items:
- "{{ kube_router_annotations_all }}"
delegate_to: "{{ groups['kube_control_plane'][0] }}"