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 b787af6
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 16 deletions.
10 changes: 10 additions & 0 deletions jetstreamiuenv/group_vars/controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ group_packages:
- git

jetstream_scratch0_device: /dev/sdb

directories:
- path: /jetstream
- path: /var/lib/slurm
mode: "0755"

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
10 changes: 10 additions & 0 deletions jetstreamtaccenv/group_vars/controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ group_packages:
- git

jetstream_scratch0_device: /dev/sdb

directories:
- path: /jetstream
- path: /var/lib/slurm
mode: "0755"

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
8 changes: 0 additions & 8 deletions jetstreamtaccenv/group_vars/slurmclients.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ group_users:
home: /var/lib/slurm
shell: /bin/bash

# useradd creates this as 0700
# FIXME: tramples any other directories definition. at the moment this is the
# only one.
# FIXME: this does not belong here
directories:
- path: /var/lib/slurm
mode: "0755"

slurm_yum_repo_baseurl: https://depot.galaxyproject.org/yum/el/$releasever/$basearch

slurmd_spool_dir: /var/lib/slurm/slurmd/slurmd.spool
Expand Down
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 b787af6

Please sign in to comment.