1
0
Fork 0
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:
Jerry Vonau 2017-11-23 00:24:44 -06:00
parent 1775c77265
commit ac738458f0
3 changed files with 20 additions and 10 deletions

View file

@ -28,6 +28,8 @@ has_wifi_gw: "none"
#Debian
dhcpcd_result: ""
wan_in_interfaces: False
network_manager_active: False
systemd_networkd_active: False
# The values here are default local variables.
gui_wan_iface: "unset"

View file

@ -21,9 +21,17 @@
- name: Setting dhcpcd_test results
set_fact:
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 }}'
dhcpcd_result: "{{ ansible_local.local_facts.dhcpcd }}"
- 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
shell: grep {{ device_gw }} /etc/network/interfaces | wc -l
@ -187,10 +195,10 @@
value: '{{ device_gw2 }}'
- option: 'dhcpcd_result'
value: '{{ dhcpcd_result }}'
- option: 'network_manager_result'
value: '{{ network_manager_result }}'
- option: 'systemd_networkd_result'
value: '{{ systemd_networkd_result }}'
- option: 'network_manager_active'
value: '{{ network_manager_active }}'
- option: 'systemd_networkd_active'
value: '{{ systemd_networkd_active }}'
- option: 'wan_in_interfaces'
value: '{{ wan_in_interfaces }}'
- option: 'wireless_list_1(wifi1)'

View file

@ -94,14 +94,14 @@
include_tasks: NM-debian.yml
tags:
- network
when: is_debuntu and network_manager_result == "enabled"
when: is_debuntu and network_manager_active
#and not installing
- name: systemd-networkd in use
include_tasks: sysd-netd-debian.yml
tags:
- network
when: is_debuntu and systemd_network_result == "enabled"
when: is_debuntu and systemd_networkd_active
#and not installing
- name: RPi's have dhcpcd in use
@ -115,7 +115,7 @@
include_tasks: debian.yml
tags:
- 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
# this is moving