69 lines
1.7 KiB
YAML
69 lines
1.7 KiB
YAML
---
|
|
- name: provision aps
|
|
hosts: accesspoints
|
|
gather_facts: no
|
|
vars:
|
|
- wifi_ssid: "GU Deutscher Platz"
|
|
- wifi_encryption: "none"
|
|
tasks:
|
|
- name: create clients bridge (vlan)
|
|
blockinfile:
|
|
path: /etc/config/network
|
|
block: |
|
|
config interface 'clients'
|
|
option type 'bridge'
|
|
option ifname 'eth0.2'
|
|
notify:
|
|
- reload network
|
|
|
|
- name: configure wireless
|
|
template:
|
|
src: templates/aruba-ap-105_wireless.j2
|
|
dest: /etc/config/wireless
|
|
notify:
|
|
- reload wifi
|
|
|
|
# current os ships with that package and leaks mac addresses into prometheus
|
|
# therefore we nuke it
|
|
- name: remove prometheus-node-exporter-lua-hostapd_stations
|
|
opkg:
|
|
name: prometheus-node-exporter-lua-hostapd_stations
|
|
state: absent
|
|
notify:
|
|
- restart prometheus-node-exporter-lua
|
|
|
|
- name: uninstall vanilla prometheus-node-exporter-lua-wifi
|
|
opkg:
|
|
name: prometheus-node-exporter-lua-wifi
|
|
state: absent
|
|
notify:
|
|
- restart prometheus-node-exporter-lua
|
|
|
|
- name: install custom prometheus-node-exporter-lua-wifi
|
|
copy:
|
|
src: files/wifi.lua
|
|
dest: /usr/lib/lua/prometheus-collectors/wifi.lua
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
notify:
|
|
- restart prometheus-node-exporter-lua
|
|
|
|
- name: install iwinfo
|
|
opkg:
|
|
name: iwinfo
|
|
|
|
handlers:
|
|
- name: reload network
|
|
service:
|
|
name: network
|
|
state: reloaded
|
|
|
|
- name: reload wifi
|
|
command: wifi reconf
|
|
|
|
- name: restart prometheus-node-exporter-lua
|
|
service:
|
|
name: prometheus-node-exporter-lua
|
|
state: restarted
|