1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

use the new routine

This commit is contained in:
Jerry Vonau 2020-04-22 12:38:49 -05:00
parent c6a2140329
commit 575b66fb6e

View file

@ -19,22 +19,16 @@
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
- name: Create /etc/hostapd/hostapd.conf from template
- name: Create /etc/hostapd/hostapd.conf and backup .iiab from template
template:
src: hostapd/hostapd.conf.j2
dest: /etc/hostapd/hostapd.conf
owner: root
group: root
mode: 0644
when: discovered_wireless_iface != "none"
- name: Create backup /etc/hostapd/hostapd.conf.iiab from template
template:
src: hostapd/hostapd.conf.j2
dest: /etc/hostapd/hostapd.conf.iiab
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: discovered_wireless_iface != "none"
- name: Generate new random mac address for ap0
@ -47,11 +41,16 @@
- name: Use custom 'hostapd' systemd service unit file using ap0 when wifi_up_down
template:
src: hostapd/hostapd.service.j2
dest: /etc/systemd/system/hostapd.service
owner: root
group: root
mode: 0644
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- { src: 'hostapd/hostapd.service.j2', dest: '/etc/systemd/system/hostapd.service' }
- { src: 'hostapd/clone-wifi.service.j2', dest: '/etc/systemd/system/clone-wifi.service' }
- { src: 'hostapd/wifi-test.service.j2', dest: '/etc/systemd/system/wifi-test.service' }
- { src: 'hostapd/test-wifi', dest: '/sbin/test-wifi' }
when: discovered_wireless_iface != "none" and wifi_up_down
- name: Use custom 'hostapd' systemd service unit file for {{ discovered_wireless_iface }} when not wifi_up_down
@ -137,7 +136,18 @@
systemd:
name: hostapd
enabled: yes
when: hostapd_enabled
when: hostapd_enabled and not wifi_up_down
- name: Enable the Access Point 'hostapd' service
systemd:
name: "{{ item }}"
masked: no
enabled: yes
with_items:
- hostapd.service
- clone-wifi.service
- wifi-test.service
when: hostapd_enabled and wifi_up_down
- name: Record HOSTAPD_ENABLED to {{ iiab_env_file }}
lineinfile: