Skip to content

Commit 38b7cea

Browse files
committed
DLPX-86539 Update the permissions of the directory only if it exists
1 parent 2ea24a3 commit 38b7cea

File tree

1 file changed

+11
-3
lines changed
  • files/common/var/lib/delphix-platform/ansible/10-delphix-platform/roles/delphix-platform/tasks

1 file changed

+11
-3
lines changed

files/common/var/lib/delphix-platform/ansible/10-delphix-platform/roles/delphix-platform/tasks/main.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,19 @@
739739
state: absent
740740
regexp: '^\s*PATH\s*='
741741

742-
- file:
742+
# Check if the specified directories exist to update the permissions
743+
- stat:
743744
path: "{{ item }}"
744-
state: directory
745-
mode: 0750
746745
with_items:
747746
- /export/home/delphix
748747
- /export/home/cli
749748
- /var/lib/postgresql
749+
register: dir_check
750+
751+
# Update the permissions of the directory only if it exists
752+
- file:
753+
path: "{{ item.stat.path }}"
754+
state: directory
755+
mode: 0750
756+
when: item.stat.exists
757+
with_items: "{{ dir_check.results }}"

0 commit comments

Comments
 (0)