sassoftware / viya4-iac-gcp

This project contains Terraform configuration files to provision infrastructure components required to deploy SAS Viya platform products on Google Cloud
Apache License 2.0
21 stars 17 forks source link

fix: (IAC-1091) Prevent Jump VM cloud-init from overwriting existing file permissions/ownership #189

Closed jarpat closed 1 year ago

jarpat commented 1 year ago

Changes:

When a new jump server vm is created, it sets file ownership and permissions for the mounted NFS location which allows Viya services to initialize successfully. Importantly, the file system settings should only be applied once and not repeatedly in the event that the jump vm is destroyed and recreated in the same cluster. This change checks if the ${jump_rwx_filestore_path}/pvs folder already exists and skips creating the folder and recursively setting ownerships and permissions if it does. If the jump vm is being created for the first time when the pvs folder is absent, creating the folder and setting permissions and ownership will occur an initial time and not thereafter.

Tests:

Executed the following workflow to verify that file permissions and ownership was not modified on Jump VM recreation

Steps:

jarpat commented 1 year ago

This is fine and I know we recently did this for one of the other providers, we now have to ensure that if this directory exists that we document that on its initial run the permissions need to be set to 777 and the owner/group needs to be modified as nobody:nogroup as we now cannot guarantee this. So doc will be needed here and in the other provider or providers we've updated with this code check.

Hey @thpang, on this line in the cloud-init https://github.com/sassoftware/viya4-iac-gcp/blob/IAC-1091/files/cloud-init/jump/cloud-config#L34 we document the new functionality. Would making this section a bit more verbose to describe the updated behavior more clearly be what you are looking for?