ham-hotspot/roles/base/tasks/main.yml
2025-04-26 12:59:37 -05:00

48 lines
1.1 KiB
YAML

---
- name: Install base system packages
apt:
name:
- ax25-tools
- ax25-apps
- libax25
- dnsmasq
- hostapd
- python3-flask
- build-essential
- cmake
- git
- alsa-utils
- libasound2-dev
state: present
update_cache: yes
- name: Install unblock-wlan service
template:
src: unblock-wlan.service.j2
dest: /etc/systemd/system/unblock-wlan.service
mode: '0644'
notify: Reload systemd
- name: Ensure /etc/wpa_supplicant/wpa_supplicant.conf exists
file:
path: /etc/wpa_supplicant/wpa_supplicant.conf
state: touch
owner: root
group: root
mode: '0644'
- name: Ensure Wi-Fi country is set
blockinfile:
path: /etc/wpa_supplicant/wpa_supplicant.conf
marker: "# {mark} ANSIBLE MANAGED BLOCK - Wi-Fi Country Setting"
block: |
country={{ wifi.country }}
when: ansible_facts['distribution'] in ['Debian', 'Raspbian']
notify: Restart unblock-wlan service
- name: Unmask hostapd service
systemd:
name: hostapd
masked: no
notify: Reload systemd