Skip to content

Commit

Permalink
DLPX-86524 Update path in /etc/security/pam_env.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
dbshah12 committed Sep 17, 2024
1 parent 1a0b53f commit d18d53f
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -720,10 +720,12 @@
when: not ansible_is_chroot

#
# Ensure /snap/bin is removed from PATH in /etc/environment
# Add correct path in /etc/security/pam_env.conf to Ensure that
# non-existent paths are not included in the global PATH
#
- lineinfile:
path: /etc/environment
regexp: '^PATH='
line: "{{ lookup('file', '/etc/environment') | regex_search('^PATH=.*') | regex_replace(':/snap/bin', '') }}"
when: "'/snap/bin' in lookup('file', '/etc/environment')"
path: /etc/security/pam_env.conf
state: present
regexp: '^\s*PATH\s+DEFAULT='
line: 'PATH DEFAULT=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
insertbefore: '^# End of file'

0 comments on commit d18d53f

Please sign in to comment.