1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

boolean in template needs ==t/f

This commit is contained in:
Jerry Vonau 2017-09-09 20:54:23 -05:00
parent 788407cc9a
commit 78cd58ca8a
3 changed files with 58 additions and 8 deletions

View file

@ -23,20 +23,27 @@
- name: For upgrades from earlier IIAB 6.2, remove br0 file - name: For upgrades from earlier IIAB 6.2, remove br0 file
file: path=/etc/network/interfaces.d/br0 file: path=/etc/network/interfaces.d/br0
state=absent state=absent
when: iiab_lan_iface != "br0" and wan_ip == "dhcp"
- name: Default to 'lan_controller' - name: Default to 'lan_controller'
set_fact: set_fact:
gui_desired_network_role: "lan_controller" gui_desired_network_role: "lan_controller"
when: not gui_desired_network_role is defined when: not gui_desired_network_role is defined
- name: Recover from putting config in /etc/network/interfaces - name: Supply resolvconf.conf
template: dest=/etc/network/interfaces template: dest=/etc/resolvconf.conf
src=network/interfaces.j2 src=network/resolvconf.j2
- name: Supply dhcpcd.conf
template: dest=/etc/dhcpcd.conf
src=network/dhcpcd.conf.j2
when: dhcpcd_result == "enabled" and (iiab_lan_iface == "br0" or wan_ip != "dhcp")
- name: Copy the bridge script - name: Copy the bridge script
template: dest=/etc/network/interfaces.d/iiab template: dest=/etc/network/interfaces.d/iiab
src=network/iiab.j2 src=network/iiab.j2
register: interface register: interface
when: iiab_lan_iface == "br0" or wan_ip != "dhcp"
- name: Start up the dhcpcd service - name: Start up the dhcpcd service
service: name=dhcpcd service: name=dhcpcd

View file

@ -21,6 +21,7 @@
- name: On upgrade from earlier IIAB versions, remove /etc/network/interfaces.d/br0 - name: On upgrade from earlier IIAB versions, remove /etc/network/interfaces.d/br0
file: path=/etc/network/interfaces.d/br0 file: path=/etc/network/interfaces.d/br0
state=absent state=absent
when: iiab_lan_iface != "br0" and wan_ip == "dhcp"
- name: Default to 'LanController' - name: Default to 'LanController'
set_fact: set_fact:
@ -33,12 +34,14 @@
- name: Supply our own dhcpcd.conf - name: Supply our own dhcpcd.conf
template: dest=/etc/dhcpcd.conf template: dest=/etc/dhcpcd.conf
src=network/dhcpcd.conf src=network/dhcpcd.conf.j2
when: iiab_lan_iface == "br0" or wan_ip != "dhcp"
- name: Copy the network config script - name: Copy the network config script
template: dest=/etc/network/interfaces.d/iiab template: dest=/etc/network/interfaces.d/iiab
src=network/iiab.j2 src=network/iiab.j2
register: interface register: interface
when: iiab_lan_iface == "br0" or wan_ip != "dhcp"
- name: If this was a change, things need to shift - name: If this was a change, things need to shift
service: name=hostapd state=stopped service: name=hostapd state=stopped

View file

@ -1,9 +1,49 @@
# This file describes the network interfaces available on your system # This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5). # and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/* {% if iiab_network_mode == "Appliance" %}
################# APPLIANCE #########################
{% if dhcpcd_result != "enabled" or wan_in_interfaces == "false" %}
auto {{ iiab_wan_iface }}
iface {{ iiab_wan_iface }} inet dhcp
{% else %} # gui_static_wan_ip is set
iface {{ iiab_wan_iface }} inet manual
{% endif %} {# end of dhcp_wan #}
# The loopback network interface {% if wan_ip != "dhcp" %}
auto lo auto {{ iiab_wan_iface }}
iface lo inet loopback iface {{ iiab_wan_iface }} inet static
address {{ wan_ip }}
netmask {{ wan_netmask }}
gateway {{ wan_gateway }}
dns-nameservers {{ wan_nameserver }}
dns-search {{ iiab_domain }}
{% endif %} {# end of static_wan #}
{% elif iiab_network_mode == "Gateway" %}
################# GATEWAY #########################
auto br0
iface br0 inet static
bridge_ports {% if iiab_wireless_lan_iface != "none" %} {{ iiab_wireless_lan_iface }} {% endif %} {% if discovered_lan_iface != "none" %} {{ discovered_lan_iface }} {% endif %}
bridge_maxwait 0
address {{ lan_ip }}
netmask {{ lan_netmask }}
dns-nameservers {{ lan_ip }}
{% if dhcpcd_result != "enabled" or wan_in_interfaces == "false" %}
auto {{ iiab_wan_iface }}
iface {{ iiab_wan_iface }} inet dhcp
{% else %} # gui_static_wan_ip is set
iface {{ iiab_wan_iface }} inet manual
{% endif %} {# end of dhcp_wan #}
{% if wan_ip != "dhcp" %}
auto {{ iiab_wan_iface }}
iface {{ iiab_wan_iface }} inet static
address {{ wan_ip }}
netmask {{ wan_netmask }}
gateway {{ wan_gateway }}
dns-nameservers {{ wan_nameserver }}
dns-search {{ iiab_domain }}
{% endif %}
{% else %} {# end of iiab_network_mode == Gateway #}