Skip to content

Commit

Permalink
fix: (IAC-1091) Prevent Jump VM cloud-init from overwriting existing …
Browse files Browse the repository at this point in the history
…file permissions/ownership (#189)
  • Loading branch information
jarpat authored Aug 4, 2023
1 parent 683fc5d commit 47068cb
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions files/cloud-init/jump/cloud-config
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ runcmd:
# mount the nfs
#
- while [ `df -h | grep "${rwx_filestore_endpoint}:${rwx_filestore_path}" | wc -l` -eq 0 ]; do sleep 5 && mount -a ; done
#
# Change permissions and owner
#
- mkdir -p ${jump_rwx_filestore_path}/pvs
- $(chmod -fR 777 ${jump_rwx_filestore_path} ; echo)
- $(chown -R nobody:nogroup ${jump_rwx_filestore_path} ; echo)
# Create pvs folder and adjust perms and owner only if the folder doesn't exist
# On subsequent jump server creation if the mounted NFS already contains a "pvs" directory
# don't overwrite ownerships and permissions set by SAS Viya
- if ! [ -d "${jump_rwx_filestore_path}/pvs" ]
- then
#
# Change permissions and owner
#
- mkdir -p ${jump_rwx_filestore_path}/pvs
- $(chmod -fR 777 ${jump_rwx_filestore_path} ; echo)
- $(chown -R nobody:nogroup ${jump_rwx_filestore_path} ; echo)
- fi
- fi

0 comments on commit 47068cb

Please sign in to comment.