Skip to content

Commit

Permalink
Use autofs for mounting Jetstream scratch on nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
natefoo committed May 17, 2016
1 parent 364ce6e commit 938fd7d
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 8 deletions.
8 changes: 8 additions & 0 deletions jetstreamiuenv/group_vars/controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ group_packages:
- git

jetstream_scratch0_device: /dev/sdb

directories:
- path: /jetstream

links:
- path: /jetstream/scratch0
src: /scratch0
force: yes
1 change: 1 addition & 0 deletions jetstreamiuenv/group_vars/galaxynodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ links:

jetstream_nfs_filesystems:
- device: "10.0.0.6:/scratch0"
dir: scratch0
mountpoint: /jetstream/iu-scratch0
8 changes: 8 additions & 0 deletions jetstreamtaccenv/group_vars/controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ group_packages:
- git

jetstream_scratch0_device: /dev/sdb

directories:
- path: /jetstream

links:
- path: /jetstream/scratch0
src: /scratch0
force: yes
1 change: 1 addition & 0 deletions jetstreamtaccenv/group_vars/galaxynodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ links:

jetstream_nfs_filesystems:
- device: "10.0.0.9:/scratch0"
dir: scratch0
mountpoint: /jetstream/tacc-scratch0
28 changes: 28 additions & 0 deletions roles/jetstream_nfs/tasks/client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---

- name: Remove static mounts
mount:
fstype: nfs4
name: "{{ item.mountpoint }}"
src: "{{ item.device }}"
state: unmounted
with_items: "{{ jetstream_nfs_filesystems }}"

- name: Install autofs (yum)
yum:
name: autofs
when: ansible_os_family == "RedHat"

- name: Add Jetstream mounts to auto.master
copy:
dest: /etc/auto.master.d/auto.ansible_jetstream.autofs
content: "/jetstream /etc/auto.jetstream --ghost\n"
backup: yes
notify: reload autofs

- name: Create auto.jetstream
template:
src: auto.jetstream.j2
dest: /etc/auto.jetstream
backup: yes
notify: reload autofs
9 changes: 1 addition & 8 deletions roles/jetstream_nfs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,5 @@
- include: server.yml
when: "'controllers' in group_names"

- name: Mount scratch
mount:
fstype: nfs4
name: "{{ item.mountpoint }}"
src: "{{ item.device }}"
opts: rw,nosuid,noatime,rsize=1048576,wsize=1048576,intr,soft,tcp
state: mounted
with_items: "{{ jetstream_nfs_filesystems }}"
- include: client.yml
when: "'jetstreamnfsclients' in group_names"
3 changes: 3 additions & 0 deletions roles/jetstream_nfs/templates/auto.jetstream.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% for fs in jetstream_nfs_filesystems %}
{{ fs.dir }} -fstype=nfs4,rw,nosuid,noatime,rsize=1048576,wsize=1048576,intr,soft,tcp {{ fs.device }}
{% endfor %}

0 comments on commit 938fd7d

Please sign in to comment.