back to singular

This commit is contained in:
2022-09-24 20:55:50 +02:00
parent 0e20f83a67
commit dd00b2840a
60 changed files with 51 additions and 51 deletions

View File

@@ -0,0 +1,61 @@
- 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
register: postgres_script
- name: database | snmpd | modify script part 1
lineinfile:
path: "/etc/snmp/postgres"
regexp: "^\$cpg -u $DBuser --action dbstats | awk -F ' ' '$"
state: present
line: "$cpg --action dbstats | awk -F ' ' '"
when: postgres_script.rc == 0
- name: database | snmpd | modify script part 2
replace:
path: "/etc/snmp/postgres"
regexp: "\\:"
replace: ":"
when: postgres_script.rc == 0
- 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: "{{ snmpd_conf }}"
state: present
line: "extend postgres {{ sudo }} -u postgres /etc/snmp/postgres"
insertafter: "# SECTION: Extends"
notify: restart_snmpd
when: postgres == true
- name: database | snmpd | configure extend
lineinfile:
path: "{{ snmpd_conf }}"
state: present
line: "extend mysql /etc/snmp/mysql"
insertafter: "# SECTION: Extends"
notify: restart_snmpd
when: mysql == true