Expand secure_path with support for Suse (#381)
This commit is contained in:
parent
a64e882fb7
commit
9b6d551dd6
4
roles/prereq/defaults/main.yml
Normal file
4
roles/prereq/defaults/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
secure_path:
|
||||||
|
RedHat: '/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin'
|
||||||
|
Suse: '/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin'
|
||||||
@ -60,10 +60,10 @@
|
|||||||
|
|
||||||
- name: Add /usr/local/bin to sudo secure_path
|
- name: Add /usr/local/bin to sudo secure_path
|
||||||
lineinfile:
|
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)*="
|
regexp: "Defaults(\\s)*secure_path(\\s)*="
|
||||||
state: present
|
state: present
|
||||||
insertafter: EOF
|
insertafter: EOF
|
||||||
path: /etc/sudoers
|
path: /etc/sudoers
|
||||||
validate: 'visudo -cf %s'
|
validate: 'visudo -cf %s'
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_os_family in [ "RedHat", "Suse" ]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user