Skip to content

Instantly share code, notes, and snippets.

@florian-asche
Created June 19, 2023 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florian-asche/ba380b1ff817b4379f703eb40bec06bd to your computer and use it in GitHub Desktop.
Save florian-asche/ba380b1ff817b4379f703eb40bec06bd to your computer and use it in GitHub Desktop.
Ansible Playbook for Pihole and OpenWRT
# pihole
- hosts: storage
gather_facts: false # needed for os detection
ignore_unreachable: true
roles:
- { role: own_pihole_dns_entries, tags: ["pihole_custom", "pihole_conf"] }
# openWRT
# DONE: Packages und System komplett
# TODO: wirless, dnsmasq, ser2net, und network fehlen
- hosts: openwrt
become: false
gather_facts: false # needed for os detection
ignore_unreachable: true
#vars:
roles:
- { role: gekmihesg.openwrt, tags: ["openwrt", "openwrt_system", "openwrt_packages", "openwrt_dhcp"] }
- { role: pe_pe.openwrt_config_system, tags: ["openwrt", "openwrt_system"] }
- { role: pe_pe.openwrt_config_packages, tags: ["openwrt", "openwrt_package"] }
#- pe_pe.openwrt_config_network
#- pe_pe.openwrt_config_wireless
- { role: pe_pe.openwrt_config_dhcp, tags: ["openwrt", "openwrt_dhcp"] }
tags:
- openwrt
vars:
openwrt_config_packages:
- ser2net
- luci-app-ser2net
- kmod-usb-serial
- kmod-usb-serial-cp210x # ZIGBEE XIAOMI STICK
- prometheus-node-exporter-lua
- prometheus-node-exporter-lua-nat_traffic
- prometheus-node-exporter-lua-netstat
- prometheus-node-exporter-lua-openwrt
- prometheus-node-exporter-lua-uci_dhcp_host
- prometheus-node-exporter-lua-wifi
- prometheus-node-exporter-lua-wifi_stations
#- prometheus-statsd-exporter
tasks:
- name: Set prometheus interface
uci:
command: set
key: prometheus-node-exporter-lua.main.listen_interface
type: prometheus-node-exporter-lua
value: 'ADMIN'
tags:
- openwrt_prometheus
- name: commit changes
uci:
command: commit
tags:
- openwrt_prometheus
# todo:
# feel free to help me here
# enable prometheus exporter
# start prometheus exporter
# /etc/init.d/prometheus-node-exporter-lua restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment