Skip to content

Commit 8a92404

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

File tree

1 file changed

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

1 file changed

+11
-4
lines changed

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

+11-4
Original file line numberDiff line numberDiff line change
@@ -739,11 +739,18 @@
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
748-
- /export/home/cli
749747
- /var/lib/postgresql
748+
register: dir_check
749+
750+
# Update the permissions of the directory only if it exists
751+
- file:
752+
path: "{{ item.stat.path }}"
753+
state: directory
754+
mode: 0750
755+
when: item.stat.exists
756+
with_items: "{{ dir_check.results }}"

0 commit comments

Comments
 (0)