From f9d73d57d8ea2581082ce177b88bc0e502f21b20 Mon Sep 17 00:00:00 2001 From: Bo-Chun Louis Chen <louistw@uab.edu> Date: Fri, 22 Nov 2024 15:31:29 -0600 Subject: [PATCH] feat: update structure of mount_points variable Now as a dictionary that includes: - src: mount source - path: mount path - opts: mount options --- ansible/group_vars/all | 4 ++-- ansible/roles/nfs_mounts/tasks/fstab.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/group_vars/all b/ansible/group_vars/all index 59f6612..48c6de8 100644 --- a/ansible/group_vars/all +++ b/ansible/group_vars/all @@ -30,8 +30,8 @@ # nfs_mounts related use_autofs: false mount_points: - - /gpfs4 - - /gpfs5 + - { "src": "master:/gpfs4", "path": "/gpfs4", "opts": "rw,sync,hard" } + - { "src": "master:/gpfs5", "path": "/gpfs5", "opts": "rw,sync,hard" } #SSH Host Keys S3_ENDPOINT: "" diff --git a/ansible/roles/nfs_mounts/tasks/fstab.yml b/ansible/roles/nfs_mounts/tasks/fstab.yml index 100c042..6b1a1d2 100644 --- a/ansible/roles/nfs_mounts/tasks/fstab.yml +++ b/ansible/roles/nfs_mounts/tasks/fstab.yml @@ -1,7 +1,7 @@ --- - name: Create base directories ansible.builtin.file: - path: "{{ item }}" + path: "{{ item.path }}" state: directory mode: '0755' loop: @@ -9,9 +9,9 @@ - name: Mount the directories ansible.posix.mount: - src: "master:{{ item }}" - path: "{{ item }}" - opts: rw,sync,hard + src: "{{ item.src }}" + path: "{{ item.path }}" + opts: "{{ item.opts }}" state: mounted fstype: nfs loop: -- GitLab