# \[gluster\_volume\] Can't set options for a gluster volume

**URL:** <https://forum.ansible.com/t/gluster-volume-cant-set-options-for-a-gluster-volume/20880>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [March 16, 2016, 4:04am UTC](https://forum.ansible.com/t/gluster-volume-cant-set-options-for-a-gluster-volume/20880 "2016-03-16T04:04:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![royal.forest.dept](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@royal.forest.dept](https://forum.ansible.com/u/royal.forest.dept)\
**Post date:** [March 16, 2016, 4:04am UTC](https://forum.ansible.com/t/gluster-volume-cant-set-options-for-a-gluster-volume/20880/1 "2016-03-16T04:04:50Z")

</div>

Hi, I’m trying to set an option for a gluster volume with this task:

- name: Include hosted\_engine volume in virt group  
gluster\_volume: state=present name=hosted\_engine options=‘{group: virt}’  
run\_once: true

The format is from the [2nd example of gluster\_volume module](http://docs.ansible.com/ansible/gluster_volume_module.html) doc. However, the playbook doesn’t run at all:

ERROR! Syntax Error while loading YAML.

The error appears to have been in ‘/home/vagrant/ansible-ovirt/1\_prepare\_gluster.yml’: line 30, column 69, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Include hosted\_engine volume in virt group  
gluster\_volume: state=present name=hosted\_engine options=‘{group: virt}’  
^ here

**ATTEMPT#2** Changed options to options=‘{group:virt}’ and options={group:virt}, the playbook runs, but failed at this task:

fatal: [172.28.128.3]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “argument options is of type \<type ‘str’\> and we were unable to convert to dict”}

**ATTEMPT#3** Changed options to options=“{‘group’:‘virt’}”, the playbook runs, but failed at this task:

fatal: [172.28.128.3]: FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “”, “module\_stdout”: “Traceback (most recent call last):\r\n File "/root/.ansible/tmp/ansible-tmp-1458099335.97-214924974739646/gluster\_volume", line 2416, in \r\n main()\r\n File "/root/.ansible/tmp/ansible-tmp-1458099335.97-214924974739646/gluster\_volume", line 382, in main\r\n probe\_all\_peers(cluster, peers, myhostname)\r\n File "/root/.ansible/tmp/ansible-tmp-1458099335.97-214924974739646/gluster\_volume", line 259, in probe\_all\_peers\r\n for host in hosts:\r\nTypeError: ‘NoneType’ object is not iterable\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}

(Don’t know why /root/.ansible/… appears in the error message since I didn’t run the playbook with any root privilege)

I can just ssh into one of my remote hosts and run gluster volume set hosted\_engine group virt but would like to know how to do this in Ansible.

I’m using Ansible 2.0.1 in Ubuntu 14.04.3 and all of my remote hosts are CentOS 7.

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 18, 2016, 2:40am UTC](https://forum.ansible.com/t/gluster-volume-cant-set-options-for-a-gluster-volume/20880/2 "2016-03-18T02:40:09Z")

</div>

You are mixing YAML and key=val notations, that does not work.

gluster\_volume:  
state: present  
name: hosted\_engine  
options:  
group: virt
