fix ansible facts using for os family and major dist version

This commit is contained in:
ace 2022-01-26 17:18:53 +03:00
parent c2a8942b8e
commit 24d2dfc522
No known key found for this signature in database
GPG Key ID: 2E47CC17BA7F8CF0
2 changed files with 6 additions and 15 deletions

View File

@ -8,7 +8,9 @@
ip6: "{{ omit if iface.ip6 is not defined else (iface.ip6|join(', ')) }}" ip6: "{{ omit if iface.ip6 is not defined else (iface.ip6|join(', ')) }}"
gw4: "{{ iface.gw4 | default(omit) }}" gw4: "{{ iface.gw4 | default(omit) }}"
gw6: "{{ iface.gw6 | default(omit) }}" gw6: "{{ iface.gw6 | default(omit) }}"
never_default4: "{{ iface.never_default4 | default('yes') }}" dns4: "{{ iface.dns4 | default(omit) }}"
dns6: "{{ iface.dns6 | default(omit) }}"
never_default4: "{{ iface.never_default4 | default(omit) }}"
vlanid: "{{ iface.vlanid | default(omit) }}" vlanid: "{{ iface.vlanid | default(omit) }}"
mtu: "{{ iface.mtu | default(0) }}" mtu: "{{ iface.mtu | default(0) }}"
zone: "{{ iface.zone | default(omit) }}" zone: "{{ iface.zone | default(omit) }}"
@ -53,7 +55,9 @@
ip6: "{{ omit if iface.ip6 is not defined else (iface.ip6|join(', ')) }}" ip6: "{{ omit if iface.ip6 is not defined else (iface.ip6|join(', ')) }}"
gw4: "{{ iface.gw4 | default(omit) }}" gw4: "{{ iface.gw4 | default(omit) }}"
gw6: "{{ iface.gw6 | default(omit) }}" gw6: "{{ iface.gw6 | default(omit) }}"
never_default4: "{{ iface.never_default4 | default('yes') }}" dns4: "{{ iface.dns4 | default(omit) }}"
dns6: "{{ iface.dns6 | default(omit) }}"
never_default4: "{{ iface.never_default4 | default(omit) }}"
vlanid: "{{ iface.vlanid | default(omit) }}" vlanid: "{{ iface.vlanid | default(omit) }}"
routes4: "{{ iface.routes4 if (existing_routes4 != new_routes4) else omit }}" routes4: "{{ iface.routes4 if (existing_routes4 != new_routes4) else omit }}"
routing_rules4: "{{ iface.routing_rules4 | default(omit) }}" routing_rules4: "{{ iface.routing_rules4 | default(omit) }}"

View File

@ -1,13 +0,0 @@
---
- name: Set blank routes symbol
command: echo -n
register: echo
changed_when: false
- name: Create array for interfaces to reload
set_fact:
reload_interfaces: []
changed_when: false
- name: Include interfaces configuration tasks
include: "{{ ansible_os_family }}/{{ ansible_distribution_major_version }}.yaml"