From e9aae150f4ba0cf26debd49d3d69fdc479d1a93b Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Mon, 13 Nov 2017 00:20:08 -0600 Subject: [PATCH] rpi test 3 wifi flip on reboot --- roles/network/tasks/main.yml | 18 ++++++++--- .../templates/hostapd/iiab-hostapd.conf.j2 | 32 +++++++++++++++++++ 2 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 roles/network/templates/hostapd/iiab-hostapd.conf.j2 diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 34f377dbe..7915d7f3b 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -8,6 +8,19 @@ - network - network-discover +- include_tasks: hostapd.yml + tags: + - network + - AP + +- name: RPi hack for AP post install via wifi so the services are right + set_fact: + no_net_restart: True + hostapd_enabled: False + iiab_wan_iface: discovered_wired_iface + iiab_wireless_lan_iface: discovered_wireless_iface + when: is_rpi and discovered_wireless_iface is defined and discovered_wireless_iface == iiab_wan_iface + - include_tasks: computed_network.yml when: not installing tags: @@ -47,11 +60,6 @@ tags: - network -- include_tasks: hostapd.yml - tags: - - network - - AP - - include_tasks: computed_services.yml tags: - network diff --git a/roles/network/templates/hostapd/iiab-hostapd.conf.j2 b/roles/network/templates/hostapd/iiab-hostapd.conf.j2 new file mode 100644 index 000000000..5ee541281 --- /dev/null +++ b/roles/network/templates/hostapd/iiab-hostapd.conf.j2 @@ -0,0 +1,32 @@ +# Basic configuration + +interface={{ discovered_wireless_iface }} + +ssid={{ host_ssid }} +channel={{ host_channel }} +{%if iiab_lan_iface == "br0" %} +bridge=br0 +{% endif %} + +# Hardware configuration +driver={{ driver_name }} +{%if host_wireless_n %} +ieee80211n=1 +{% endif %} +country_code={{ host_country_code }} +# limit emissions to what is legal in country +ieee80211d=1 +hw_mode={{ host_wifi_mode }} + +{%if hostapd_secure %} +# Use WPA authentication +auth_algs=1 +# Use WPA2 +wpa=2 +# Use a pre-shared key +wpa_key_mgmt=WPA-PSK +# The network passphrase +wpa_passphrase={{ hostapd_password }} +# Use AES, instead of TKIP +rsn_pairwise=CCMP +{% endif %}