summaryrefslogtreecommitdiff
path: root/host-librenms.yml
diff options
context:
space:
mode:
Diffstat (limited to 'host-librenms.yml')
-rw-r--r--host-librenms.yml45
1 files changed, 45 insertions, 0 deletions
diff --git a/host-librenms.yml b/host-librenms.yml
new file mode 100644
index 0000000..b7b4d66
--- /dev/null
+++ b/host-librenms.yml
@@ -0,0 +1,45 @@
+- name: Setup LibreNMS to handle
+ hosts: pve
+ become: true
+ gather_facts: true
+ pre_tasks:
+ - set_fact:
+ snmp_user_internal: "{{ snmp_user_internal | default(lookup('password', '/dev/null length=15 chars=ascii_letters')) }}"
+ snmp_user_password_auth: "{{ snmp_user_password_auth | default(lookup('password', '/dev/null length=15 chars=ascii_letters')) }}"
+ snmp_user_password_privacy: "{{ snmp_user_password_privacy | default(lookup('password', '/dev/null length=15 chars=ascii_letters')) }}"
+ roles:
+ - role: oefenweb.apt
+ apt_debian_contrib_nonfree_enable: true
+ apt_manage_sources_list: true
+ apt_src_enable: false
+ apt_backports_enable: false
+ apt_debian_mirror: "http://debian.mithril.re/debian"
+ apt_install:
+ - snmp-mibs-downloader
+ - role: oefenweb.snmpd
+ snmpd_sys_description: "{{ inventory_hostname }}"
+ snmpd_sys_contact: "Matthieu <m@mpgn.dev>"
+ snmpd_opts: "-LSwd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -p /run/snmpd.pid"
+ snmpd_internal_user:
+ username: administrator
+ password: "{{ snmp_user_internal }}"
+ auth_protocol: SHA
+ snmpd_install: []
+ snmpd_agent_address:
+ - "udp:@struct:161"
+ - "udp:@lan:161"
+ - "udp:@cluster:161"
+ - "udp:@vrfbr_pantheon:161"
+ snmpd_mibs: "SNMPv2-TC:SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB:SNMP-VACM-MIB"
+ snmpd_users:
+ - username: librenms
+ password: "{{ snmp_user_password_auth }}"
+ type: rouser
+ auth_protocol: SHA
+ privacy_passphrase: "{{ snmp_user_password_privacy }}"
+ privacy_protocol: AES
+ post_tasks:
+ - name: update the librenms configuration
+ ansible.builtin.command: ./script/librenms-provision.py -auth-algo SHA -auth-secret {{ snmp_user_password_auth }} -auth-name librenms -crypto-algo AES -crypto-secret {{ snmp_user_password_privacy }} -hostname {{ ansible_hostname }}
+ delegate_to: 127.0.0.1
+ chdir: "{{ playbook_dir }}"