ctucx.git: ansible-configs

My personal ansible roles and playbooks [deprecated in favor of nixos]

commit 734b84c27175f1e26520d196ec905b77f3ce79ad
parent 34e2206e192d51f2f76fcd6678d3ccc4f768a1e2
Author: Leah Thein <leah@toaster.home.ctu.cx>
Date: Sun, 6 Dec 2020 23:32:04 +0100

hostapd: add role
2 files changed, 41 insertions(+), 0 deletions(-)
A
roles/hostapd/tasks/main.yml
|
18
++++++++++++++++++
A
roles/hostapd/templates/hostapd.conf.j2
|
23
+++++++++++++++++++++++
diff --git a/roles/hostapd/tasks/main.yml b/roles/hostapd/tasks/main.yml
@@ -0,0 +1,18 @@
+---
+
+- name: "Install package: hostapd" 
+  apk:
+   name: hostapd 
+   state: present
+   update_cache: yes
+
+- name: "create file: /etc/hostapd/hostapd.conf"
+  template:
+    src: hostapd.conf.j2
+    dest: /etc/hostapd/hostapd.conf
+
+- name: "Enable and restart service: hostapd"
+  service:
+   name: hostapd
+   enabled: yes
+   state: restarted
diff --git a/roles/hostapd/templates/hostapd.conf.j2 b/roles/hostapd/templates/hostapd.conf.j2
@@ -0,0 +1,23 @@
+interface={{hostapd.interface}}
+bridge={{hostapd.bridge}}
+
+ssid={{hostapd.ssid}}
+driver=nl80211
+country_code=DE
+
+hw_mode=g
+channel={{hostapd.channel}}
+
+wpa=2
+auth_algs=1
+
+rsn_pairwise=CCMP
+wpa_key_mgmt=WPA-PSK
+wpa_passphrase={{hostapd.passphrase}}
+
+logger_stdout=-1
+logger_stdout_level=2
+
+ieee80211n=1
+wmm_enabled=1
+ht_capab=[HT40+]