replaced sudo command with global sudo var
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
snmpd_conf: /etc/snmp/snmpd.conf
|
snmpd_conf: /etc/snmp/snmpd.conf
|
||||||
|
sudo: {{ sudo }}
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
lineinfile:
|
lineinfile:
|
||||||
path: "{{ snmpd_conf }}"
|
path: "{{ snmpd_conf }}"
|
||||||
state: present
|
state: present
|
||||||
line: "extend postgres /usr/bin/sudo -u postgres /etc/snmp/postgres"
|
line: "extend postgres {{ sudo }} -u postgres /etc/snmp/postgres"
|
||||||
insertafter: "# SECTION: Extends"
|
insertafter: "# SECTION: Extends"
|
||||||
notify: restart_snmpd
|
notify: restart_snmpd
|
||||||
when: postgres == true
|
when: postgres == true
|
||||||
|
|||||||
@@ -10,6 +10,6 @@
|
|||||||
lineinfile:
|
lineinfile:
|
||||||
path: "{{ snmpd_conf }}"
|
path: "{{ snmpd_conf }}"
|
||||||
state: present
|
state: present
|
||||||
line: "extend unbound /usr/bin/sudo /etc/snmp/unbound"
|
line: "extend unbound {{ sudo }} /etc/snmp/unbound"
|
||||||
insertafter: "# SECTION: Extends"
|
insertafter: "# SECTION: Extends"
|
||||||
notify: restart_snmpd
|
notify: restart_snmpd
|
||||||
@@ -76,8 +76,8 @@
|
|||||||
line: "extend {{ item.service }} '{{ item.script }}'"
|
line: "extend {{ item.service }} '{{ item.script }}'"
|
||||||
insertafter: "# SECTION: custom settings"
|
insertafter: "# SECTION: custom settings"
|
||||||
loop:
|
loop:
|
||||||
- { service: "distro", script: "/usr/bin/sudo /etc/snmp/distro" }
|
- { service: "distro", script: "{{ sudo }} /etc/snmp/distro" }
|
||||||
- { service: "osupdate", script: "/usr/bin/sudo /etc/snmp/osupdate"}
|
- { service: "osupdate", script: "{{ sudo }} /etc/snmp/osupdate" }
|
||||||
- { service: "hardware", script: "/bin/cat /sys/devices/virtual/dmi/id/product_name" }
|
- { service: "hardware", script: "/bin/cat /sys/devices/virtual/dmi/id/product_name" }
|
||||||
- { service: "manufacturer", script: "/bin/cat /sys/devices/virtual/dmi/id/sys_vendor" }
|
- { service: "manufacturer", script: "/bin/cat /sys/devices/virtual/dmi/id/sys_vendor" }
|
||||||
- { service: "serial", script: "/bin/cat /sys/devices/virtual/dmi/id/product_serial" }
|
- { service: "serial", script: "/bin/cat /sys/devices/virtual/dmi/id/product_serial" }
|
||||||
|
|||||||
Reference in New Issue
Block a user