Romain
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
16 additions and
13 deletions
-
roles/reset/defaults/main.yml
-
roles/reset/tasks/main.yml
|
|
@ -1,3 +1,18 @@ |
|
|
|
--- |
|
|
|
flush_iptables: 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 |
|
|
|
service: |
|
|
|
# noqa: jinja[spacing] |
|
|
|
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 %} |
|
|
|
name: "{{ reset_restart_network_service_name }}" |
|
|
|
state: restarted |
|
|
|
when: |
|
|
|
- ansible_os_family not in ["Flatcar", "Flatcar Container Linux by Kinvolk"] |
|
|
|