mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
use results to set_facts
This commit is contained in:
parent
1775c77265
commit
ac738458f0
3 changed files with 20 additions and 10 deletions
|
@ -28,6 +28,8 @@ has_wifi_gw: "none"
|
||||||
#Debian
|
#Debian
|
||||||
dhcpcd_result: ""
|
dhcpcd_result: ""
|
||||||
wan_in_interfaces: False
|
wan_in_interfaces: False
|
||||||
|
network_manager_active: False
|
||||||
|
systemd_networkd_active: False
|
||||||
|
|
||||||
# The values here are default local variables.
|
# The values here are default local variables.
|
||||||
gui_wan_iface: "unset"
|
gui_wan_iface: "unset"
|
||||||
|
|
|
@ -21,9 +21,17 @@
|
||||||
|
|
||||||
- name: Setting dhcpcd_test results
|
- name: Setting dhcpcd_test results
|
||||||
set_fact:
|
set_fact:
|
||||||
dhcpcd_result: '{{ ansible_local.local_facts.dhcpcd }}'
|
dhcpcd_result: "{{ ansible_local.local_facts.dhcpcd }}"
|
||||||
systemd_networkd_result: '{{ ansible_local.local_facts.systemd_networkd }}'
|
|
||||||
network_manager_result: '{{ ansible_local.local_facts.network_manager }}'
|
- name: Setting systemd_networkd results
|
||||||
|
set_fact:
|
||||||
|
systemd_networkd_active: True
|
||||||
|
when: 'ansible_local.local_facts.systemd_networkd == "enabled"'
|
||||||
|
|
||||||
|
- name: Setting network_manager results
|
||||||
|
set_fact:
|
||||||
|
network_manager_active: True
|
||||||
|
when: 'ansible_local.local_facts.network_manager == "enabled"'
|
||||||
|
|
||||||
- name: Check /etc/network/interfaces for gateway
|
- name: Check /etc/network/interfaces for gateway
|
||||||
shell: grep {{ device_gw }} /etc/network/interfaces | wc -l
|
shell: grep {{ device_gw }} /etc/network/interfaces | wc -l
|
||||||
|
@ -187,10 +195,10 @@
|
||||||
value: '{{ device_gw2 }}'
|
value: '{{ device_gw2 }}'
|
||||||
- option: 'dhcpcd_result'
|
- option: 'dhcpcd_result'
|
||||||
value: '{{ dhcpcd_result }}'
|
value: '{{ dhcpcd_result }}'
|
||||||
- option: 'network_manager_result'
|
- option: 'network_manager_active'
|
||||||
value: '{{ network_manager_result }}'
|
value: '{{ network_manager_active }}'
|
||||||
- option: 'systemd_networkd_result'
|
- option: 'systemd_networkd_active'
|
||||||
value: '{{ systemd_networkd_result }}'
|
value: '{{ systemd_networkd_active }}'
|
||||||
- option: 'wan_in_interfaces'
|
- option: 'wan_in_interfaces'
|
||||||
value: '{{ wan_in_interfaces }}'
|
value: '{{ wan_in_interfaces }}'
|
||||||
- option: 'wireless_list_1(wifi1)'
|
- option: 'wireless_list_1(wifi1)'
|
||||||
|
|
|
@ -94,14 +94,14 @@
|
||||||
include_tasks: NM-debian.yml
|
include_tasks: NM-debian.yml
|
||||||
tags:
|
tags:
|
||||||
- network
|
- network
|
||||||
when: is_debuntu and network_manager_result == "enabled"
|
when: is_debuntu and network_manager_active
|
||||||
#and not installing
|
#and not installing
|
||||||
|
|
||||||
- name: systemd-networkd in use
|
- name: systemd-networkd in use
|
||||||
include_tasks: sysd-netd-debian.yml
|
include_tasks: sysd-netd-debian.yml
|
||||||
tags:
|
tags:
|
||||||
- network
|
- network
|
||||||
when: is_debuntu and systemd_network_result == "enabled"
|
when: is_debuntu and systemd_networkd_active
|
||||||
#and not installing
|
#and not installing
|
||||||
|
|
||||||
- name: RPi's have dhcpcd in use
|
- name: RPi's have dhcpcd in use
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
include_tasks: debian.yml
|
include_tasks: debian.yml
|
||||||
tags:
|
tags:
|
||||||
- network
|
- network
|
||||||
when: not is_rpi and network_manager_result != "enabled" and systemd_network_result != "enabled" and is_debuntu
|
when: not is_rpi and not network_manager_active and not systemd_networkd_active and is_debuntu
|
||||||
#and not installing
|
#and not installing
|
||||||
|
|
||||||
# this is moving
|
# this is moving
|
||||||
|
|
Loading…
Reference in a new issue