1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

wifi really is turned off by rfkill until wpa_supplicant has country=

This commit is contained in:
George Hunt 2018-03-29 20:39:20 +00:00
parent 5c074e59a4
commit 227b5f4c32
4 changed files with 38 additions and 25 deletions

View file

@ -14,7 +14,7 @@ device_gw2: ""
iiab_wan_iface: "none"
iiab_lan_iface: "none"
#discovered_lan_iface: "none"
discovered_lan_iface: "none"
discovered_wired_iface: "none"
discovered_wireless_iface: "none"
#iiab_wired_lan_iface: "none"

View file

@ -167,6 +167,26 @@
iiab_wan_iface: "none"
when: adapter_count.stdout|int >= "5" and device_gw == "none" and gui_wan_iface == "unset" and gui_static_wan is defined
- name: Record IIAB_WAN_DEVICE to /etc/iiab/iiab.env
lineinfile:
dest: /etc/iiab/iiab.env
regexp: '^IIAB_WAN_DEVICE=*'
line: 'IIAB_WAN_DEVICE="{{ iiab_wan_iface }}"'
state: present
when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
tags:
- network
- name: Record IIAB_LAN_DEVICE to /etc/iiab/iiab.env
lineinfile:
dest: /etc/iiab/iiab.env
regexp: '^IIAB_LAN_DEVICE=*'
line: 'IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"'
state: present
when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
tags:
- network
- name: Add location section to config file
ini_file:
dest: "{{ iiab_config_file }}"

View file

@ -132,27 +132,6 @@
tags:
- network
# this is moving
- name: Record IIAB_WAN_DEVICE to /etc/iiab/iiab.env
lineinfile:
dest: /etc/iiab/iiab.env
regexp: '^IIAB_WAN_DEVICE=*'
line: 'IIAB_WAN_DEVICE="{{ iiab_wan_iface }}"'
state: present
when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
tags:
- network
- name: Record IIAB_LAN_DEVICE to /etc/iiab/iiab.env
lineinfile:
dest: /etc/iiab/iiab.env
regexp: '^IIAB_LAN_DEVICE=*'
line: 'IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"'
state: present
when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
tags:
- network
#### end network layout
- include_tasks: restart.yml
when: not installing

View file

@ -20,10 +20,21 @@
dest: /etc/dhcpcd.conf
src: network/dhcpcd.conf.j2
- name: New raspbian requires counry code -- check for it
shell: grep country /etc/wpa_supplicant/wpa_supplicant.conf
register: country_code
- name: Put a country code if it does not exist
lineinfile:
dest: /etc/wpa_supplicant/wpa_supplicant.conf
regexp: "^country.*"
line: country={{ host_country_code }}
when: country_code.stdout == ""
- name: Copy the bridge script for RPi
template:
dest: /etc/network/interfaces.d/iiab
src: network/rpi.j2
src: network/iiab.j2
when: iiab_lan_iface == "br0"
- name: Stopping services
@ -48,9 +59,12 @@
- name: Restart hostapd if appropriate
service:
name: hostapd
enabled: yes
state: restarted
when: hostapd_enabled and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance"
when: hostapd_enabled and iiab_wan_iface != discoveed_wireless_iface and iiab_network_mode != "Appliance"
- name: Ansible is having a problem enabling services
shell: systemctl enable hostapd
when: hostapd_enabled and iiab_wan_iface != discoveed_wireless_iface and iiab_network_mode != "Appliance"
#- name: dhcp_server may be affected - starting - user choice
# service: name={{ dhcp_service2 }} state=started