From 91e154656d288578cc842aa53dc197970002a9f4 Mon Sep 17 00:00:00 2001 From: Keir Badger Date: Mon, 20 May 2024 09:44:55 +0000 Subject: [PATCH] Add in configurable mount point for EFS file systems --- files/cluster_instance_setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/cluster_instance_setup.py b/files/cluster_instance_setup.py index 9747265..6ebfb02 100755 --- a/files/cluster_instance_setup.py +++ b/files/cluster_instance_setup.py @@ -3,7 +3,7 @@ """Setup cluster instance. Usage: - cluster-instance-setup [--ebs-volumes=] [--efs-filesystem=] + cluster-instance-setup [--ebs-volumes=] [--efs-filesystem=] [--efs-filesystem-mnt=] cluster-instance-setup (-h | --help) cluster-instance-setup --version @@ -12,6 +12,7 @@ --version Show version. --ebs-volumes= JSON array of ebs volumes to attach. --efs-filesystem= ID of EFS filesystem to mount. + --efs-filesystem-mnt= Where to mount the EFS disk """ # noqa @@ -89,7 +90,7 @@ def main(arguments): LOGGER.info("Done attaching ebs volumes.") if arguments.get("--efs-filesystem") is not None: LOGGER.info("Configuring EFS...") - configure_efs(arguments.get("--efs-filesystem")) + configure_efs(arguments.get("--efs-filesystem"), arguments.get("--efs-filesystem-mnt", "/mnt/efs")) LOGGER.info("Done configuring EFS.") @@ -359,9 +360,8 @@ def attach_ebs_volumes(volumes): return False -def configure_efs(filesystem_id): +def configure_efs(filesystem_id, mount_point): metadata = fetch_instance_metadata() - mount_point = "/mnt/efs" check_call(["mkdir", "-p", mount_point]) with open("/etc/fstab", "a") as handle: handle.write(