Initial commit
This commit is contained in:
24
ansible/roles/monitoring/tasks/main.yml
Normal file
24
ansible/roles/monitoring/tasks/main.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
- name: Create exporter directory
|
||||
file:
|
||||
path: "{{ exporter_install_dir }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Deploy exporter configuration
|
||||
template:
|
||||
src: exporter-config.json.j2
|
||||
dest: /etc/wg-lab-exporter/config.json
|
||||
mode: '0644'
|
||||
|
||||
- name: Create systemd service
|
||||
template:
|
||||
src: wg-lab-exporter.service.j2
|
||||
dest: /etc/systemd/system/wg-lab-exporter.service
|
||||
|
||||
- name: Enable and start exporter
|
||||
systemd:
|
||||
name: wg-lab-exporter
|
||||
enabled: yes
|
||||
state: started
|
||||
daemon_reload: yes
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"labs": {
|
||||
"{{ gateway_config.lab_name }}": {
|
||||
"vni": {{ gateway_config.vni }},
|
||||
"lab_if": "{{ gateway_config.lab_if }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=WireGuard Lab Exporter
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/python3 /opt/wg-lab-exporter/wg_lab_exporter.py
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user