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
@@ -3,13 +3,13 @@
service:
# noqa: jinja[spacing]
name: >-
{% if ansible_os_family == "RedHat" -%}
{% if ansible_facts['os_family'] == "RedHat" -%}
network
{%- elif ansible_distribution == "Ubuntu" and ansible_distribution_release == "bionic" -%}
{%- elif ansible_facts['distribution'] == "Ubuntu" and ansible_facts['distribution_release'] == "bionic" -%}
systemd-networkd
{%- elif ansible_os_family == "Debian" -%}
{%- elif ansible_facts['os_family'] == "Debian" -%}
networking
{%- endif %}
state: restarted
when: not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] and kube_network_plugin not in ['calico']
when: not ansible_facts['os_family'] in ["Flatcar", "Flatcar Container Linux by Kinvolk"] and kube_network_plugin not in ['calico']
listen: Macvlan | restart network
+3 -3
View File
@@ -25,10 +25,10 @@
dest: /etc/network/interfaces.d/60-mac0.cfg
mode: "0644"
notify: Macvlan | restart network
when: ansible_os_family in ["Debian"]
when: ansible_facts['os_family'] in ["Debian"]
- name: Install macvlan config on RH distros
when: ansible_os_family == "RedHat"
when: ansible_facts['os_family'] == "RedHat"
block:
- name: Macvlan | Install macvlan script on centos
copy:
@@ -61,7 +61,7 @@
notify: Macvlan | restart network
- name: Install macvlan config on Flatcar
when: ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
when: ansible_facts['os_family'] in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
block:
- name: Macvlan | Install service nat via gateway on Flatcar Container Linux
template: