mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
grouping, recording, staging
This commit is contained in:
parent
cf67d4c9d7
commit
ef6486b09b
5 changed files with 43 additions and 42 deletions
|
@ -81,22 +81,3 @@
|
||||||
value: "{{ dnsmasq_enabled }}"
|
value: "{{ dnsmasq_enabled }}"
|
||||||
- option: no_net_restart
|
- option: no_net_restart
|
||||||
value: "{{ no_net_restart }}"
|
value: "{{ no_net_restart }}"
|
||||||
- option: hostapd_enabled
|
|
||||||
value: "{{ hostapd_enabled }}"
|
|
||||||
- option: host_ssid
|
|
||||||
value: "{{ host_ssid }}"
|
|
||||||
- option: host_wifi_mode
|
|
||||||
value: "{{ host_wifi_mode }}"
|
|
||||||
- option: host_channel
|
|
||||||
value: "{{ host_channel }}"
|
|
||||||
|
|
||||||
- name: Add 'network' variable 'current_client_channel' value if defined, to {{ iiab_ini_file }}
|
|
||||||
ini_file:
|
|
||||||
dest: "{{ iiab_ini_file }}"
|
|
||||||
section: network
|
|
||||||
option: "{{ item.option }}"
|
|
||||||
value: "{{ item.value | string }}"
|
|
||||||
with_items:
|
|
||||||
- option: client_wifi_channel
|
|
||||||
value: "{{ current_client_channel.stdout }}"
|
|
||||||
when: current_client_channel.stdout is defined
|
|
||||||
|
|
|
@ -9,6 +9,17 @@
|
||||||
enabled: no
|
enabled: no
|
||||||
when: not hostapd_enabled
|
when: not hostapd_enabled
|
||||||
|
|
||||||
|
- name: Detect WiFi country code in use
|
||||||
|
shell: iw reg get | grep country | grep -v UNSET | awk '{print $2}' | sed "s|:||"
|
||||||
|
register: REG_DOM
|
||||||
|
ignore_errors: True
|
||||||
|
when: wifi_up_down and can_be_ap and has_wifi_gateway is defined
|
||||||
|
|
||||||
|
- name: Set Wifi Region country code for hostapd when present
|
||||||
|
set_fact:
|
||||||
|
host_country_code: "{{ REG_DOM.stdout }}"
|
||||||
|
when: REG_DOM.stdout is defined and REG_DOM.stdout | length > 0
|
||||||
|
|
||||||
- name: Detect current Wifi channel
|
- name: Detect current Wifi channel
|
||||||
shell: iw {{ discovered_wireless_iface }} info | grep channel | cut -d' ' -f2
|
shell: iw {{ discovered_wireless_iface }} info | grep channel | cut -d' ' -f2
|
||||||
register: current_client_channel
|
register: current_client_channel
|
||||||
|
@ -88,3 +99,32 @@
|
||||||
regexp: '^HOSTAPD_ENABLED=*'
|
regexp: '^HOSTAPD_ENABLED=*'
|
||||||
line: 'HOSTAPD_ENABLED={{ hostapd_enabled }}'
|
line: 'HOSTAPD_ENABLED={{ hostapd_enabled }}'
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Record host_country_code_applied and host_channel in network of {{ iiab_ini_file }}
|
||||||
|
ini_file:
|
||||||
|
dest: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
|
||||||
|
section: network
|
||||||
|
option: "{{ item.option }}"
|
||||||
|
value: "{{ item.value | string }}"
|
||||||
|
with_items:
|
||||||
|
- option: hostapd_enabled
|
||||||
|
value: "{{ hostapd_enabled }}"
|
||||||
|
- option: host_ssid
|
||||||
|
value: "{{ host_ssid }}"
|
||||||
|
- option: host_wifi_mode
|
||||||
|
value: "{{ host_wifi_mode }}"
|
||||||
|
- option: host_country_code_applied
|
||||||
|
value: "{{ host_country_code }}"
|
||||||
|
- option: host_channel
|
||||||
|
value: "{{ host_channel }}"
|
||||||
|
|
||||||
|
- name: Add 'network' variable 'current_client_channel' value if defined, to {{ iiab_ini_file }}
|
||||||
|
ini_file:
|
||||||
|
dest: "{{ iiab_ini_file }}"
|
||||||
|
section: network
|
||||||
|
option: "{{ item.option }}"
|
||||||
|
value: "{{ item.value | string }}"
|
||||||
|
with_items:
|
||||||
|
- option: client_wifi_channel
|
||||||
|
value: "{{ current_client_channel.stdout }}"
|
||||||
|
when: current_client_channel.stdout is defined
|
||||||
|
|
|
@ -61,8 +61,6 @@
|
||||||
# when: squid_install and FQDN_changed and iiab_stage|int == 9
|
# when: squid_install and FQDN_changed and iiab_stage|int == 9
|
||||||
|
|
||||||
#### Start services
|
#### Start services
|
||||||
- name: hostapd
|
|
||||||
include_tasks: hostapd.yml
|
|
||||||
- name: computed_services
|
- name: computed_services
|
||||||
include_tasks: computed_services.yml
|
include_tasks: computed_services.yml
|
||||||
- name: enable_services
|
- name: enable_services
|
||||||
|
@ -94,6 +92,9 @@
|
||||||
#when: (not is_raspbian and not network_manager_active and not systemd_networkd_active and is_debuntu) or is_ubuntu_16
|
#when: (not is_raspbian and not network_manager_active and not systemd_networkd_active and is_debuntu) or is_ubuntu_16
|
||||||
#### end network layout
|
#### end network layout
|
||||||
|
|
||||||
|
- name: hostapd
|
||||||
|
include_tasks: hostapd.yml
|
||||||
|
|
||||||
- name: Restart services
|
- name: Restart services
|
||||||
include_tasks: restart.yml
|
include_tasks: restart.yml
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,6 @@
|
||||||
- wpa_supplicant
|
- wpa_supplicant
|
||||||
when: wifi_up_down and hostapd_enabled
|
when: wifi_up_down and hostapd_enabled
|
||||||
|
|
||||||
- name: Record host_country_code_applied in network of iiab_ini_file
|
|
||||||
ini_file:
|
|
||||||
dest: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
|
|
||||||
section: network
|
|
||||||
option: "{{ item.option }}"
|
|
||||||
value: "{{ item.value | string }}"
|
|
||||||
with_items:
|
|
||||||
- option: host_country_code_applied
|
|
||||||
value: "{{ host_country_code }}"
|
|
||||||
|
|
||||||
- name: Create /etc/hostapd/hostapd.conf and backup .iiab from template if needed
|
- name: Create /etc/hostapd/hostapd.conf and backup .iiab from template if needed
|
||||||
template:
|
template:
|
||||||
owner: root
|
owner: root
|
||||||
|
|
|
@ -87,17 +87,6 @@
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
|
||||||
- name: Detect WiFi country code in use
|
|
||||||
shell: iw reg get | grep country | grep -v UNSET | awk '{print $2}' | sed "s|:||"
|
|
||||||
register: REG_DOM
|
|
||||||
ignore_errors: True
|
|
||||||
when: wifi_up_down and can_be_ap and has_wifi_gateway is defined
|
|
||||||
|
|
||||||
- name: Set Wifi Region country code for hostapd when present
|
|
||||||
set_fact:
|
|
||||||
host_country_code: "{{ REG_DOM.stdout }}"
|
|
||||||
when: REG_DOM.stdout is defined and REG_DOM.stdout | length > 0
|
|
||||||
|
|
||||||
- name: Clone wifi if needed
|
- name: Clone wifi if needed
|
||||||
systemd:
|
systemd:
|
||||||
name: iiab-clone-wifi
|
name: iiab-clone-wifi
|
||||||
|
|
Loading…
Reference in a new issue