From 2fe43c0d412bcbaa6e3b6f592c3715d42bc715c5 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sun, 2 Dec 2018 23:16:08 -0600 Subject: [PATCH] softcode apo_mac_addr --- roles/network/defaults/main.yml | 35 +++++++++++++++++++ .../templates/hostapd/70-persistent-net.rules | 2 +- .../templates/hostapd/hostapd.service.j2 | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 7cdf5b37c..b46dc0930 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -97,6 +97,41 @@ wondershaper_upspeed: "1024" # Unused # network_config_dir: /etc/network/interfaces.d +# Wi-Fi +host_ssid: IIAB +hostapd_wait: 1 +host_wifi_mode: g +host_channel: 6 +host_wireless_n: False +ap0_mac_addr: b8:27:99:12:34:56 +# Below moved to /etc/iiab/local_vars.yml: (so implementer sets this) +#host_country_code: US +hostapd_secure: True +hostapd_password: "iiab2017" +driver_name: nl80211 +hostapd_enabled: True +# Above is forcibly set to False (in roles/network/tasks/main.yml) if IIAB is +# being WiFi-installed (run "iiab-hotspot-on" AFTER ./iiab-install completes +# and content is downloaded, to enable the internal WiFi Access Point / AP!) +reboot_to_AP: False +# For those installing IIAB over WiFi: "reboot_to_AP: True" overrides the above +# detection of WiFi-as-gateway, forcing "hostapd_enabled: True" regardless. + +network_config_dir: /etc/network/interfaces.d +#iiab_network_mode: "Gateway" +dns_jail_enabled: False +services_externally_visible: False + +# DNS / name resolution +dhcpd_install: True +dhcpd_enabled: False +#dhcp_service: ???? # Set in individual OS's /opt/iiab/iiab/vars/.yml for use in roles/network/tasks/dhcpd.yml +#dhcp_service2: "dhcpd disabled" # Moved to roles/network/tasks/computed_services.yml as community transitions from named/BIND to dnsmasq (PR #1202) +named_install: True +named_enabled: False +dnsmasq_enabled: True +dnsmasq_install: True + # Originally for @tim-moody's Nodogsplash approach to Captive Portal # Highly experimental as of June 2018: https://github.com/iiab/iiab/issues/608 # diff --git a/roles/network/templates/hostapd/70-persistent-net.rules b/roles/network/templates/hostapd/70-persistent-net.rules index 7bb53337d..3ced0ef8b 100644 --- a/roles/network/templates/hostapd/70-persistent-net.rules +++ b/roles/network/templates/hostapd/70-persistent-net.rules @@ -1,3 +1,3 @@ SUBSYSTEM=="ieee80211", ACTION=="add|change", KERNEL=="phy0", \ RUN+="/sbin/iw phy phy0 interface add ap0 type __ap", \ - RUN+="/sbin/ip link set ap0 address b8:27:99:12:34:56" + RUN+="/sbin/ip link set ap0 address {{ ap0_mac_addr }}" diff --git a/roles/network/templates/hostapd/hostapd.service.j2 b/roles/network/templates/hostapd/hostapd.service.j2 index 26195358e..73500c0f6 100644 --- a/roles/network/templates/hostapd/hostapd.service.j2 +++ b/roles/network/templates/hostapd/hostapd.service.j2 @@ -7,7 +7,7 @@ Before=network.target dhcpcd.service Type=idle PIDFile=/run/hostapd.pid ExecStartPre=/sbin/iw phy phy0 interface add ap0 type __ap 2>1 > /dev/null -ExecStartPre=/sbin/ip link set ap0 address b8:27:99:12:34:56 2>1 > /dev/null +ExecStartPre=/sbin/ip link set ap0 address {{ ap0_mac_addr }} 2>1 > /dev/null ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid /etc/hostapd/hostapd.conf [Install]