mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
Merge pull request #3555 from jvonau/hotfix
iiab-clone-wifi needs template from hostapd - record wifi_up_down
This commit is contained in:
commit
57bf481315
4 changed files with 20 additions and 25 deletions
|
@ -100,6 +100,18 @@
|
||||||
line: 'HOSTAPD_ENABLED={{ hostapd_enabled }}'
|
line: 'HOSTAPD_ENABLED={{ hostapd_enabled }}'
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Create /etc/hostapd/hostapd.conf and backup .iiab from template if needed
|
||||||
|
template:
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
with_items:
|
||||||
|
- { src: 'hostapd/hostapd.conf.j2', dest: '/etc/hostapd/hostapd.conf' }
|
||||||
|
- { src: 'hostapd/hostapd.conf.j2', dest: '/etc/hostapd/hostapd.conf.iiab' }
|
||||||
|
when: can_be_ap
|
||||||
|
|
||||||
- name: Record host_country_code_applied and host_channel in network of {{ iiab_ini_file }}
|
- name: Record host_country_code_applied and host_channel in network of {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
dest: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
|
dest: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
|
||||||
|
@ -113,6 +125,8 @@
|
||||||
value: "{{ host_ssid }}"
|
value: "{{ host_ssid }}"
|
||||||
- option: host_wifi_mode
|
- option: host_wifi_mode
|
||||||
value: "{{ host_wifi_mode }}"
|
value: "{{ host_wifi_mode }}"
|
||||||
|
- option: wifi_up_down
|
||||||
|
value: "{{ wifi_up_down }}"
|
||||||
- option: host_country_code_applied
|
- option: host_country_code_applied
|
||||||
value: "{{ host_country_code }}"
|
value: "{{ host_country_code }}"
|
||||||
- option: host_channel
|
- option: host_channel
|
||||||
|
|
|
@ -14,18 +14,6 @@
|
||||||
- wpa_supplicant
|
- wpa_supplicant
|
||||||
when: wifi_up_down and hostapd_enabled
|
when: wifi_up_down and hostapd_enabled
|
||||||
|
|
||||||
- name: Create /etc/hostapd/hostapd.conf and backup .iiab from template if needed
|
|
||||||
template:
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ item.dest }}"
|
|
||||||
with_items:
|
|
||||||
- { src: 'hostapd/hostapd.conf.j2', dest: '/etc/hostapd/hostapd.conf' }
|
|
||||||
- { src: 'hostapd/hostapd.conf.j2', dest: '/etc/hostapd/hostapd.conf.iiab' }
|
|
||||||
when: can_be_ap
|
|
||||||
|
|
||||||
- name: Enable & Restart networkd-dispatcher.service
|
- name: Enable & Restart networkd-dispatcher.service
|
||||||
systemd:
|
systemd:
|
||||||
name: networkd-dispatcher
|
name: networkd-dispatcher
|
||||||
|
@ -34,6 +22,12 @@
|
||||||
masked: no
|
masked: no
|
||||||
when: systemd_networkd_active
|
when: systemd_networkd_active
|
||||||
|
|
||||||
|
- name: Clone wifi if needed
|
||||||
|
systemd:
|
||||||
|
name: iiab-clone-wifi
|
||||||
|
state: restarted
|
||||||
|
when: wifi_up_down and can_be_ap and ansible_ap0 is undefined
|
||||||
|
|
||||||
- name: Restart hostapd when WiFi is present but not when using WiFi as gateway with wifi_up_down False
|
- name: Restart hostapd when WiFi is present but not when using WiFi as gateway with wifi_up_down False
|
||||||
systemd:
|
systemd:
|
||||||
name: hostapd
|
name: hostapd
|
||||||
|
|
|
@ -78,12 +78,6 @@
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
|
||||||
- name: Clone wifi if needed
|
|
||||||
systemd:
|
|
||||||
name: iiab-clone-wifi
|
|
||||||
state: restarted
|
|
||||||
when: wifi_up_down and can_be_ap and ansible_ap0 is undefined
|
|
||||||
|
|
||||||
- name: Restart the networking service if appropriate
|
- name: Restart the networking service if appropriate
|
||||||
systemd:
|
systemd:
|
||||||
name: networking
|
name: networking
|
||||||
|
|
|
@ -87,12 +87,6 @@
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
|
||||||
- name: Clone wifi if needed
|
|
||||||
systemd:
|
|
||||||
name: iiab-clone-wifi
|
|
||||||
state: restarted
|
|
||||||
when: wifi_up_down and can_be_ap and ansible_ap0 is undefined
|
|
||||||
|
|
||||||
- name: Enable & Restart systemd-networkd.service
|
- name: Enable & Restart systemd-networkd.service
|
||||||
systemd:
|
systemd:
|
||||||
name: systemd-networkd
|
name: systemd-networkd
|
||||||
|
@ -106,4 +100,3 @@
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: yes
|
||||||
masked: no
|
masked: no
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue