diff --git a/roles/network/tasks/computed_services.yml b/roles/network/tasks/computed_services.yml index 26b888a8b..62546460b 100644 --- a/roles/network/tasks/computed_services.yml +++ b/roles/network/tasks/computed_services.yml @@ -89,3 +89,14 @@ 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 \ No newline at end of file diff --git a/roles/network/tasks/hostapd.yml b/roles/network/tasks/hostapd.yml index ea74d0fa2..b34b32c11 100644 --- a/roles/network/tasks/hostapd.yml +++ b/roles/network/tasks/hostapd.yml @@ -11,13 +11,13 @@ - name: Detect current Wifi channel shell: iw {{ discovered_wireless_iface }} info | grep channel | cut -d' ' -f2 - register: current_host_channel + register: current_client_channel when: discovered_wireless_iface != "none" -- name: Setting WiFi channel to {{ current_host_channel.stdout }} +- name: Setting WiFi channel to {{ current_client_channel.stdout }} set_fact: - host_channel: "{{ current_host_channel.stdout }}" - when: current_host_channel.stdout is defined and current_host_channel.stdout != "" and current_host_channel.stdout|int <= 13 + host_channel: "{{ current_client_channel.stdout }}" + when: current_client_channel.stdout is defined and current_client_channel.stdout != "" and current_client_channel.stdout|int <= 13 - name: Create /etc/hostapd/hostapd.conf and backup .iiab from template template: