replaced sudo command with global sudo var

This commit is contained in:
rene
2022-03-24 16:39:49 +01:00
parent b6aa1641cd
commit cba88dfa98
4 changed files with 6 additions and 5 deletions

View File

@@ -46,7 +46,7 @@
lineinfile:
path: "{{ snmpd_conf }}"
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"
notify: restart_snmpd
when: postgres == true

View File

@@ -10,6 +10,6 @@
lineinfile:
path: "{{ snmpd_conf }}"
state: present
line: "extend unbound /usr/bin/sudo /etc/snmp/unbound"
line: "extend unbound {{ sudo }} /etc/snmp/unbound"
insertafter: "# SECTION: Extends"
notify: restart_snmpd

View File

@@ -76,8 +76,8 @@
line: "extend {{ item.service }} '{{ item.script }}'"
insertafter: "# SECTION: custom settings"
loop:
- { service: "distro", script: "/usr/bin/sudo /etc/snmp/distro" }
- { service: "osupdate", script: "/usr/bin/sudo /etc/snmp/osupdate"}
- { service: "distro", script: "{{ sudo }} /etc/snmp/distro" }
- { service: "osupdate", script: "{{ sudo }} /etc/snmp/osupdate" }
- { 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: "serial", script: "/bin/cat /sys/devices/virtual/dmi/id/product_serial" }