Skip to content

Commit

Permalink
DLPX-86539 Update the permissions of the directory only if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
dbshah12 committed Oct 10, 2024
1 parent 2ea24a3 commit 38b7cea
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,19 @@
state: absent
regexp: '^\s*PATH\s*='

- file:
# Check if the specified directories exist to update the permissions
- stat:
path: "{{ item }}"
state: directory
mode: 0750
with_items:
- /export/home/delphix
- /export/home/cli
- /var/lib/postgresql
register: dir_check

# Update the permissions of the directory only if it exists
- file:
path: "{{ item.stat.path }}"
state: directory
mode: 0750
when: item.stat.exists
with_items: "{{ dir_check.results }}"

0 comments on commit 38b7cea

Please sign in to comment.