Skip to content
Snippets Groups Projects
Commit fb48e7d9 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Replace fstab mount with autofs setup

parent dbd31d6b
No related branches found
No related tags found
1 merge request!80Feat autofs
Pipeline #10070 failed with stages
in 4 minutes and 17 seconds
......@@ -11,20 +11,32 @@
- { dir: /data/rc/apps, mode: '0755' } # this is only required for the symlink to be happy
- { dir: /data/user, mode: '0755' }
- { dir: /data/project, mode: '0755' }
- name: Set up NFS GPFS mount point(s)
ansible.posix.mount:
path: "{{ item.path }}"
src: "{{ item.src }}"
fstype: "{{ item.fstype }}"
opts: "{{ item.opts }}"
state: present
- name: Add master map file
ansible.builtin.lineinfile:
path: "/etc/auto.master.d/gpfs.autofs"
line: "{{ item.mount_point }} /etc/auto.{{ item.map_name }}"
create: yes
loop:
- { mount_point: "/cm/shared", map_name: "cm-share" }
- { mount_point: "/data/project", map_name: "data-project" }
- { mount_point: "/data/user", map_name: "data-user" }
- { mount_point: "/data/rc/apps", map_name: "data-rc-apps" }
- { mount_point: "/scratch", map_name: "scratch" }
- { mount_point: "/home", map_name: "home" }
- name: Set up autofs map files
ansible.posix.lineinfile:
path: "/etc/auto.{{ item.map_name }}"
line: "{{ item.key }} -{{ item.opts }} {{ item.src }}"
loop:
- { path: /cm/shared, src: "gpfs.rc.uab.edu:/data/cm/shared-8.2", fstype: nfs, opts: "vers=3,_netdev,defaults" }
- { path: /data/project, src: "gpfs.rc.uab.edu:/data/project", fstype: nfs, opts: "vers=3,_netdev,defaults" }
- { path: /data/user, src: "gpfs.rc.uab.edu:/data/user", fstype: nfs, opts: "vers=3,_netdev,local_lock=posix,defaults" }
- { path: /data/rc/apps, src: "gpfs.rc.uab.edu:/data/rc/apps", fstype: nfs, opts: "vers=3,_netdev,defaults" }
- { path: /scratch, src: "gpfs.rc.uab.edu:/scratch", fstype: nfs, opts: "vers=3,_netdev,local_lock=posix,defaults" }
- { path: /home, src: "/data/user/home", fstype: none, opts: bind }
- { map_name: "cm-share", key: "*", src: "gpfs.rc.uab.edu:/data/cm/shared-8.2/&", opts: "fstype=nfs,vers=3,_netdev,defaults" }
- { map_name: "data-project", key: "*", src: "gpfs.rc.uab.edu:/data/project/&", opts: "fstype=nfs,vers=3,_netdev,defaults" }
- { map_name: "data-user", key: "*", src: "gpfs.rc.uab.edu:/data/user/&", opts: "fstype=nfs,vers=3,_netdev,local_lock=posix,defaults" }
- { map_name: "data-rc-apps", key: "*", src: "gpfs.rc.uab.edu:/data/rc/apps/&", opts: "fstype=nfs,vers=3,_netdev,defaults" }
- { map_name: "scratch", key: "*", src: "gpfs.rc.uab.edu:/scratch/&", opts: "fstype=nfs,vers=3,_netdev,local_lock=posix,defaults" }
- { map_name: "home", key: "*", src: ":/data/user/home/&", opts: 'fstype=bind' }
- name: Create symbolic links
ansible.builtin.file:
src: "{{ item.src }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment