Expand secure_path with support for Suse (#381)

This commit is contained in:
balazshasprai
2023-10-13 06:14:47 +02:00
committed by GitHub
parent a64e882fb7
commit 9b6d551dd6
2 changed files with 6 additions and 2 deletions

View File

@@ -60,10 +60,10 @@
- name: Add /usr/local/bin to sudo secure_path
lineinfile:
line: 'Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin'
line: 'Defaults secure_path = {{ secure_path[ansible_os_family] }}'
regexp: "Defaults(\\s)*secure_path(\\s)*="
state: present
insertafter: EOF
path: /etc/sudoers
validate: 'visudo -cf %s'
when: ansible_os_family == "RedHat"
when: ansible_os_family in [ "RedHat", "Suse" ]