Add a way to configure reseted networking service name. (#10428)
parent
6b34e3ef08
commit
a81c6d5448
|
@ -1,3 +1,18 @@
|
||||||
---
|
---
|
||||||
flush_iptables: true
|
flush_iptables: true
|
||||||
reset_restart_network: true
|
reset_restart_network: true
|
||||||
|
|
||||||
|
reset_restart_network_service_name: >-
|
||||||
|
{% if ansible_os_family == "RedHat" -%}
|
||||||
|
{%-
|
||||||
|
if ansible_distribution_major_version | int >= 8
|
||||||
|
or is_fedora_coreos or ansible_distribution == "Fedora" -%}
|
||||||
|
NetworkManager
|
||||||
|
{%- else -%}
|
||||||
|
network
|
||||||
|
{%- endif -%}
|
||||||
|
{%- elif ansible_distribution == "Ubuntu" -%}
|
||||||
|
systemd-networkd
|
||||||
|
{%- elif ansible_os_family == "Debian" -%}
|
||||||
|
networking
|
||||||
|
{%- endif %}
|
||||||
|
|
|
@ -429,19 +429,7 @@
|
||||||
|
|
||||||
- name: Reset | Restart network
|
- name: Reset | Restart network
|
||||||
service:
|
service:
|
||||||
# noqa: jinja[spacing]
|
name: "{{ reset_restart_network_service_name }}"
|
||||||
name: >-
|
|
||||||
{% if ansible_os_family == "RedHat" -%}
|
|
||||||
{%- if ansible_distribution_major_version | int >= 8 or is_fedora_coreos or ansible_distribution == "Fedora" -%}
|
|
||||||
NetworkManager
|
|
||||||
{%- else -%}
|
|
||||||
network
|
|
||||||
{%- endif -%}
|
|
||||||
{%- elif ansible_distribution == "Ubuntu" -%}
|
|
||||||
systemd-networkd
|
|
||||||
{%- elif ansible_os_family == "Debian" -%}
|
|
||||||
networking
|
|
||||||
{%- endif %}
|
|
||||||
state: restarted
|
state: restarted
|
||||||
when:
|
when:
|
||||||
- ansible_os_family not in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
|
- ansible_os_family not in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
|
||||||
|
|
Loading…
Reference in New Issue