mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 19:52:06 +00:00
63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
- name: Create /etc/hostapd/hostapd.conf from template
|
|
template:
|
|
src: hostapd/hostapd.conf.j2
|
|
dest: /etc/hostapd/hostapd.conf
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
when: iiab_wireless_lan_iface is defined
|
|
|
|
- name: Create /etc/hostapd/hostapd.conf.iiab from template
|
|
template:
|
|
src: hostapd/iiab-hostapd.conf.j2
|
|
dest: /etc/hostapd/hostapd.conf.iiab
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
when: discovered_wireless_iface is defined
|
|
|
|
- name: Use custom systemd unit file to start 'hostapd' service
|
|
template:
|
|
src: hostapd/hostapd.service.j2
|
|
dest: /etc/systemd/system/hostapd.service
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
|
|
- name: Create /usr/bin/iiab-hotspot-on from template
|
|
template:
|
|
src: network/iiab-hotspot-on
|
|
dest: /usr/bin/iiab-hotspot-on
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
when: is_rpi
|
|
|
|
- name: Create /usr/bin/iiab-hotspot-off from template
|
|
template:
|
|
src: network/iiab-hotspot-off
|
|
dest: /usr/bin/iiab-hotspot-off
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
when: is_rpi
|
|
|
|
- name: Disable the Access Point 'hostapd' service
|
|
systemd:
|
|
name: hostapd
|
|
enabled: no
|
|
# cheap workaround for when /etc/init.d is populated
|
|
# when: not hostapd_enabled
|
|
|
|
- name: Enable the Access Point 'hostapd' service
|
|
systemd:
|
|
name: hostapd
|
|
enabled: yes
|
|
when: hostapd_enabled and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance"
|
|
|
|
- name: Record HOSTAPD_ENABLED to /etc/iiab/iiab.env
|
|
lineinfile:
|
|
dest: /etc/iiab/iiab.env
|
|
regexp: '^HOSTAPD_ENABLED=*'
|
|
line: 'HOSTAPD_ENABLED={{ hostapd_enabled }}'
|
|
state: present
|