This repository has been archived on 2024-05-11. You can view files and clone it, but cannot push or open issues or pull requests.
eae-am-deutschen-platz/playbook_provision_accesspo...

66 lines
1.6 KiB
YAML

---
- name: provision aps
hosts: accesspoints
gather_facts: no
vars:
- wifi_ssid: "GU Deutscher Platz"
- wifi_encryption: "none"
tasks:
- name: provision /etc/config
template:
src: "{{ item }}"
dest: /etc/config/
with_fileglob:
- "templates/accesspoints/etc/config/*"
notify:
- "reload {{ item | basename }}"
# 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 wireless
command: wifi reconf
- name: reload system
service:
name: system
state: reloaded
- name: restart prometheus-node-exporter-lua
service:
name: prometheus-node-exporter-lua
state: restarted