Skip to content

Commit

Permalink
Expand secure_path with support for Suse (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
balazshasprai authored Oct 13, 2023
1 parent a64e882 commit 9b6d551
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions roles/prereq/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -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'
4 changes: 2 additions & 2 deletions roles/prereq/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]

0 comments on commit 9b6d551

Please sign in to comment.