ham-hotspot/ansible/roles/base/tasks/main.yml
2025-04-26 13:02:20 -05:00

48 lines
1.1 KiB
YAML

---
- name: Install base system packages
ansible.builtin.apt:
name:
- ax25-tools
- ax25-apps
- libax25
- dnsmasq
- hostapd
- python3-flask
- build-essential
- cmake
- git
- alsa-utils
- libasound2-dev
state: present
update_cache: true
- name: Install unblock-wlan service
ansible.builtin.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
ansible.builtin.file:
path: /etc/wpa_supplicant/wpa_supplicant.conf
state: touch
owner: root
group: root
mode: "0644"
- name: Ensure Wi-Fi country is set
ansible.builtin.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
ansible.builtin.systemd:
name: hostapd
masked: false
notify: Reload systemd