First fixes
This commit is contained in:
parent
d3299f8848
commit
c3a7ed97dd
@ -2,10 +2,14 @@
|
||||
- name: Ham Hotspot Bootstrap
|
||||
hosts: localhost
|
||||
become: yes
|
||||
connection: local
|
||||
|
||||
vars_files:
|
||||
- ../config/desired_state.yml
|
||||
|
||||
handlers:
|
||||
- import_tasks: ../handlers/main.yml
|
||||
|
||||
tasks:
|
||||
- name: Install base apt packages
|
||||
apt:
|
||||
@ -19,6 +23,8 @@
|
||||
- build-essential
|
||||
- cmake
|
||||
- git
|
||||
- alsa-utils
|
||||
- libasound2-dev
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
@ -54,6 +60,14 @@
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Create /etc/ham-hotspot directory
|
||||
file:
|
||||
path: /etc/ham-hotspot
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Deploy Direwolf configuration
|
||||
template:
|
||||
src: ../templates/direwolf.conf.j2
|
||||
@ -65,12 +79,14 @@
|
||||
src: ../templates/hostapd.conf.j2
|
||||
dest: /etc/hostapd/hostapd.conf
|
||||
mode: '0644'
|
||||
notify: Restart hostapd
|
||||
|
||||
- name: Deploy dnsmasq configuration
|
||||
template:
|
||||
src: ../templates/dnsmasq.conf.j2
|
||||
dest: /etc/dnsmasq.d/ham-hotspot.conf
|
||||
mode: '0644'
|
||||
notify: Restart dnsmasq
|
||||
|
||||
- name: Deploy axports configuration
|
||||
template:
|
||||
@ -85,10 +101,45 @@
|
||||
net.ipv4.ip_forward=1
|
||||
mode: '0644'
|
||||
|
||||
- name: Unmask hostapd service
|
||||
systemd:
|
||||
name: hostapd
|
||||
masked: no
|
||||
|
||||
- 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 in wpa_supplicant.conf
|
||||
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']
|
||||
|
||||
- name: Install unblock-wlan.service
|
||||
copy:
|
||||
src: ../systemd/unblock-wlan.service
|
||||
dest: /etc/systemd/system/unblock-wlan.service
|
||||
mode: '0644'
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Reload systemd daemon
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
|
||||
- name: Enable and start unblock-wlan.service
|
||||
systemd:
|
||||
name: unblock-wlan.service
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: Enable and start Direwolf instance
|
||||
systemd:
|
||||
name: direwolf@radio0.service
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
# Configuration state for Ham Hotspot
|
||||
|
||||
wifi:
|
||||
country: US
|
||||
ssid: HamHotspot
|
||||
password: change_me_now
|
||||
channel: 6
|
||||
18
handlers/main.yml
Normal file
18
handlers/main.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Restart hostapd
|
||||
systemd:
|
||||
name: hostapd
|
||||
state: restarted
|
||||
enabled: yes
|
||||
|
||||
- name: Restart dnsmasq
|
||||
systemd:
|
||||
name: dnsmasq
|
||||
state: restarted
|
||||
enabled: yes
|
||||
|
||||
- name: Restart unblock-wlan service
|
||||
systemd:
|
||||
name: unblock-wlan.service
|
||||
state: restarted
|
||||
enabled: yes
|
||||
@ -5,7 +5,7 @@ After=direwolf@%i.service
|
||||
AssertPathExists=/run/direwolf/%i
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
Type=simple
|
||||
ExecStart=/usr/sbin/kissattach /run/direwolf/%i %i
|
||||
ExecStartPost=/usr/sbin/kissparms -c 1 -p %i
|
||||
RemainAfterExit=true
|
||||
|
||||
12
systemd/unblock-wlan.service
Normal file
12
systemd/unblock-wlan.service
Normal file
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Unblock WiFi on boot
|
||||
After=network-pre.target
|
||||
Before=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/sbin/rfkill unblock wlan
|
||||
RemainAfterExit=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@ -16,7 +16,6 @@ TXTAIL 10
|
||||
DWAIT 0
|
||||
SLOTTIME 100
|
||||
PERSIST 63
|
||||
FIX_BITS 1 AX25
|
||||
|
||||
# Log settings
|
||||
LOGDIR /var/log/direwolf
|
||||
|
||||
Loading…
Reference in New Issue
Block a user