snmpd extends for postgres

This commit is contained in:
rene
2022-03-22 18:56:15 +01:00
parent 71f1be5e5f
commit 4b8f39ae7f
2 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
- name: database | snmpd | get script
get_url:
url: "https://github.com/librenms/librenms-agent/raw/master/snmp/postgres"
dest: "/etc/snmp/postgres"
mode: "0755"
owner: "root"
group: "root"
when: postgres == true
- include_tasks: install_check_postgres.yml
when: postgres == true
- name: database | snmpd | get script
get_url:
url: "https://github.com/librenms/librenms-agent/raw/master/snmp/mysql"
dest: "/etc/snmp/mysql"
mode: "0755"
owner: "root"
group: "root"
when: mysql == true
- name: database | snmpd | create configuration
template:
src: "mysql.cnf.j2"
dest: "/etc/snmp/mysql.cnf"
mode: "0644"
when: mysql == true
- name: database | snmpd | configure extend
lineinfile:
path: "/etc/snmp/snmpd.conf"
state: present
line: "extend postgres /etc/snmp/postgres"
insertafter: "# SECTION: Extends"
notify: restart_snmpd
when: postgres == true
- name: database | snmpd | configure extend
lineinfile:
path: "/etc/snmp/snmpd.conf"
state: present
line: "extend postgres /etc/snmp/postgres"
insertafter: "# SECTION: Extends"
notify: restart_snmpd
when: mysql == true