Skip to content

Commit d6c7c4f

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

File tree

1 file changed

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

1 file changed

+12
-5
lines changed

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

+12-5
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 }}"
745+
with_items:
746+
- /export/home/delphix
747+
- /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 }}"
744753
state: directory
745754
mode: 0750
746-
with_items:
747-
- /export/home/delphix
748-
- /export/home/cli
749-
- /var/lib/postgresql
755+
when: item.stat.exists
756+
with_items: "{{ dir_check.results }}"

0 commit comments

Comments
 (0)