Skip to content

Instantly share code, notes, and snippets.

@pol
Last active January 4, 2016 10:39
Show Gist options
  • Select an option

  • Save pol/8610268 to your computer and use it in GitHub Desktop.

Select an option

Save pol/8610268 to your computer and use it in GitHub Desktop.
What is going on here?!
PLAY [gluster-nfs-server] *****************************************************
GATHERING FACTS ***************************************************************
ok: [srv1.domain.edu]
ok: [srv2.domain.edu]
ok: [srv3.domain.edu]
ok: [srv4.domain.edu]
TASK: [debug] *****************************************************************
ok: [srv1.domain.edu] => {
"nfs_exports": "[{'hosts': ['host1.domain.edu(rw,fsid=0,anonuid=5001,anongid=5001)', 'host2.domain.edu(rw,fsid=0,anonuid=5001,anongid=5001)'], 'user': 'client1', 'dir': '/mnt/gluster/durable/clients/client1'}, {'hosts': ['host3.domain.edu(rw,fsid=0,anonuid=93824,anongid=93824)'], 'user': 'client2', 'dir': '/mnt/gluster/durable/clients/client2'}]"
}
ok: [srv4.domain.edu] => {
"nfs_exports": "[{'hosts': ['host1.domain.edu(rw,fsid=0,anonuid=5001,anongid=5001)', 'host2.domain.edu(rw,fsid=0,anonuid=5001,anongid=5001)'], 'user': 'client1', 'dir': '/mnt/gluster/durable/clients/client1'}, {'hosts': ['host3.domain.edu(rw,fsid=0,anonuid=93824,anongid=93824)'], 'user': 'client2', 'dir': '/mnt/gluster/durable/clients/client2'}]"
}
ok: [srv2.domain.edu] => {
"nfs_exports": "[{'hosts': ['host1.domain.edu(rw,fsid=0,anonuid=5001,anongid=5001)', 'host2.domain.edu(rw,fsid=0,anonuid=5001,anongid=5001)'], 'user': 'client1', 'dir': '/mnt/gluster/durable/clients/client1'}, {'hosts': ['host3.domain.edu(rw,fsid=0,anonuid=93824,anongid=93824)'], 'user': 'client2', 'dir': '/mnt/gluster/durable/clients/client2'}]"
}
ok: [srv3.domain.edu] => {
"nfs_exports": "[{'hosts': ['host1.domain.edu(rw,fsid=0,anonuid=5001,anongid=5001)', 'host2.domain.edu(rw,fsid=0,anonuid=5001,anongid=5001)'], 'user': 'client1', 'dir': '/mnt/gluster/durable/clients/client1'}, {'hosts': ['host3.domain.edu(rw,fsid=0,anonuid=93824,anongid=93824)'], 'user': 'client2', 'dir': '/mnt/gluster/durable/clients/client2'}]"
}
TASK: [ensure that the export directories exist (only necessary on the master)] ***
fatal: [srv2.domain.edu] => with_items expects a list
fatal: [srv1.domain.edu] => with_items expects a list
fatal: [srv3.domain.edu] => with_items expects a list
fatal: [srv4.domain.edu] => with_items expects a list
FATAL: all hosts have already failed -- aborting
---
- hosts: gluster-nfs-server
sudo: yes
tasks:
# --SNIP--
- name: debug
debug: var=nfs_exports
- name: ensure that the export directories exist (only necessary on the master)
file: path={{item.dir}} state=directory owner={{item.user}} group={{item.user}} mode=0750
with_items: nfs_exports
# NOTE: if I copy/paste the nfs_exports YAML here, it works.
# Also, the var works fine in a jinja template for-loop.
---
nfs_exports:
- dir: /mnt/gluster/clients/client1
user: client1
hosts:
- host1.domain.edu(rw,fsid=0,anonuid=5001,anongid=5001)
- host2.domain.edu(rw,fsid=0,anonuid=5001,anongid=5001)
- dir: /mnt/gluster/clients/client2
user: client2
hosts:
- host3.domain.edu(rw,fsid=0,anonuid=93824,anongid=93824)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment