additional adjustments for postgres snmp extend
This commit is contained in:
@@ -6,6 +6,22 @@
|
||||
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
|
||||
@@ -30,7 +46,7 @@
|
||||
lineinfile:
|
||||
path: "/etc/snmp/snmpd.conf"
|
||||
state: present
|
||||
line: "extend postgres /etc/snmp/postgres"
|
||||
line: "extend postgres /usr/bin/sudo -u postgres /etc/snmp/postgres"
|
||||
insertafter: "# SECTION: Extends"
|
||||
notify: restart_snmpd
|
||||
when: postgres == true
|
||||
@@ -39,7 +55,7 @@
|
||||
lineinfile:
|
||||
path: "/etc/snmp/snmpd.conf"
|
||||
state: present
|
||||
line: "extend postgres /etc/snmp/postgres"
|
||||
line: "extend mysql /etc/snmp/mysql"
|
||||
insertafter: "# SECTION: Extends"
|
||||
notify: restart_snmpd
|
||||
when: mysql == true
|
||||
Reference in New Issue
Block a user