snmpd: remove role

This commit is contained in:
jeltz 2023-04-04 01:28:09 +02:00
parent 833d25078d
commit 94953e1aa7
Signed by: jeltz
GPG key ID: 800882B66C0C3326
5 changed files with 0 additions and 74 deletions

View file

@ -1,18 +0,0 @@
#!/usr/bin/env ansible-playbook
---
- hosts:
- edge-1.rtr.infra.auro.re
vars:
snmpd__sys_contact: root@auro.re
snmpd__views:
systemonly:
- .1.3.6.1.2.1.1
- .1.3.6.1.2.1.25.1
snmpd__users:
aurore:
auth: "{{ vault_snmp_aurore_auth }}"
priv: "{{ vault_snmp_aurore_priv }}"
view: systemonly
roles:
- snmpd
...

View file

@ -1,7 +0,0 @@
---
snmpd__sys_name: "{{ inventory_hostname }}"
snmpd__sys_location: Unknown
snmpd__sys_services: 72
snmpd__views: {}
snmpd__users: {}
...

View file

@ -1,6 +0,0 @@
---
- name: Restart snmpd
systemd:
name: snmpd.service
state: restarted
...

View file

@ -1,21 +0,0 @@
---
- name: Install snmpd
apt:
name: snmpd
- name: Configure snmpd
template:
src: snmpd.conf.j2
dest: /etc/snmp/snmpd.conf
owner: root
group: root
mode: u=rw,g=,o=
no_log: true
notify:
- Restart snmpd
- name: Enable snmpd
systemd:
name: snmpd.service
enabled: true
...

View file

@ -1,22 +0,0 @@
{{ ansible_managed | comment }}
sysName {{ snmpd__sys_name }}
sysLocation {{ snmpd__sys_location }}
sysContact {{ snmpd__sys_contact }}
sysServices {{ snmpd__sys_services }}
master agentx
agentaddress 127.0.0.1,[::1]
{% for view, included in snmpd__views.items() %}
{% for oid in included %}
view {{ view }} included {{ oid }}
{% endfor %}
{% endfor %}
{% for name, user in snmpd__users.items() %}
createUser {{ name }} SHA-512 {{ user.auth | enquote }} AES {{ user.priv | enquote }}
rouser {{ name }} authpriv -V {{ user.view }}
{% endfor %}
includeDir /etc/snmp/snmpd.conf.d