Skip to content

Commit

Permalink
Merge pull request #5 from mantti/master
Browse files Browse the repository at this point in the history
Added variable for mountdir chmod
  • Loading branch information
martbhell authored Oct 12, 2017
2 parents 97c9e12 + e3f79df commit 4968941
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This only works if nfs_mount variable is not defined
<pre>
nfs_mounts:
- { fstype: "nfs4", name: "/home", src: "{{ nfs_mount_addr }}:/home", state: "mounted", opts: "defaults" }
- { name: "/scratch", src: "{{ nfs_mount_addr }}:/scratch" }
- { name: "/scratch", src: "{{ nfs_mount_addr }}:/scratch", dirmode: "1777" }
</pre>

Notice how fstype defaults to "nfs4", state defaults to "mounted" and opts defaults to "defaults".
Expand Down
3 changes: 1 addition & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
nfs_mounts:
- {}
# - { fstype: "nfs4", name: "/home", src: "{{ nfs_mount_addr }}:/home", state: "mounted", opts: "defaults" }
# - { name: "/scratch", src: "{{ nfs_mount_addr }}:/scratch" }
# - { name: "/scratch", src: "{{ nfs_mount_addr }}:/scratch", dirmode: "1777"}

#Overwite this to true in your playbook's variables or simply include "-e clean_fstab_backups=True" if you want to remove old fstab backup files created by bug #4
clean_fstab_backups: False

2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
## new method with the mount module

- name: Create directories (if they do not exist) if nfs_mounts is defined
file: path={{ item.name }} state=directory mode=0755
file: path={{ item.name }} state=directory mode="{{ item.dirmode | default ('0755') }}"
with_items: "{{ nfs_mounts }}"
when: nfs_mounts is defined and nfs_mounts.0 != {} and nfs_mount is not defined

Expand Down

0 comments on commit 4968941

Please sign in to comment.