additional adjustments for postgres snmp extend
This commit is contained in:
@@ -6,6 +6,22 @@
|
|||||||
owner: "root"
|
owner: "root"
|
||||||
group: "root"
|
group: "root"
|
||||||
when: postgres == true
|
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
|
- include_tasks: install_check_postgres.yml
|
||||||
when: postgres == true
|
when: postgres == true
|
||||||
@@ -30,7 +46,7 @@
|
|||||||
lineinfile:
|
lineinfile:
|
||||||
path: "/etc/snmp/snmpd.conf"
|
path: "/etc/snmp/snmpd.conf"
|
||||||
state: present
|
state: present
|
||||||
line: "extend postgres /etc/snmp/postgres"
|
line: "extend postgres /usr/bin/sudo -u postgres /etc/snmp/postgres"
|
||||||
insertafter: "# SECTION: Extends"
|
insertafter: "# SECTION: Extends"
|
||||||
notify: restart_snmpd
|
notify: restart_snmpd
|
||||||
when: postgres == true
|
when: postgres == true
|
||||||
@@ -39,7 +55,7 @@
|
|||||||
lineinfile:
|
lineinfile:
|
||||||
path: "/etc/snmp/snmpd.conf"
|
path: "/etc/snmp/snmpd.conf"
|
||||||
state: present
|
state: present
|
||||||
line: "extend postgres /etc/snmp/postgres"
|
line: "extend mysql /etc/snmp/mysql"
|
||||||
insertafter: "# SECTION: Extends"
|
insertafter: "# SECTION: Extends"
|
||||||
notify: restart_snmpd
|
notify: restart_snmpd
|
||||||
when: mysql == true
|
when: mysql == true
|
||||||
@@ -1 +1,2 @@
|
|||||||
Debian-snmp ALL = NOPASSWD: /etc/snmp/bind, /etc/snmp/fail2ban, /etc/snmp/docker-stats.sh, /etc/snmp/mailcow-dockerized-postfix
|
Debian-snmp ALL = NOPASSWD: /etc/snmp/bind, /etc/snmp/fail2ban, /etc/snmp/docker-stats.sh, /etc/snmp/mailcow-dockerized-postfix
|
||||||
|
Debian-snmp ALL = (postgres) NOPASSWD: /etc/snmp/postgres
|
||||||
Reference in New Issue
Block a user