Skip to content

Commit

Permalink
Fix Ansible error "The loop variable 'item' is already in use." in `n…
Browse files Browse the repository at this point in the history
…fs-client` setup.
  • Loading branch information
riccardomurri committed May 27, 2016
1 parent d9357e2 commit ca8593a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
tags:
- nfs
- nfs-client
include: nfsmount.yml item='{{item}}'
include: nfsmount.yml fs='{{item}}'
with_items: '{{NFS_MOUNTS}}'

Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---

- name: ensure {{item.mountpoint}} directory exists
- name: ensure {{fs.mountpoint}} directory exists
file:
path={{item.mountpoint}}
path={{fs.mountpoint}}
state=directory

- name: add to /etc/fstab
mount:
name='{{item.mountpoint}}'
src='{{item.fs}}'
name='{{fs.mountpoint}}'
src='{{fs.fs}}'
fstype=nfs
opts='{{item.options|default("rw,async")}}'
state='{{item.state|default("mounted")}}'
opts='{{fs.options|default("rw,async")}}'
state='{{fs.state|default("mounted")}}'


- name: Allow NFS homes through SELinux
command: |
setsebool -P use_nfs_home_dirs=1
when: '{{is_rhel_compatible}} and "{{item.mountpoint}}" == "/home"'
when: '{{is_rhel_compatible}} and "{{fs.mountpoint}}" == "/home"'

0 comments on commit ca8593a

Please sign in to comment.