I'm afraid I can't offer much in the way of advice, Chris. I decided not to continue my oVirt/GlusterFS experiment, and deleted the roles & playbooks I had written. Your syntax certainly seems to match what worked for me. You might want to try it without "folding-style" (>), though. Knowing how cranky the gluster_volume module is about formatting, I wouldn't be surprised if that's causing a problem.
Sorry I can't be of more assistance. Good luck! Let us know when you get it sorted. On Wed, Aug 12, 2015 at 1:37 AM, Chris Weeks <[email protected]> wrote: > Thank you for sharing this information, I had come across the exact same > problem - use case: gluster storage backends for oVirt clusters. > > My role includes the following: > > - name: Gluster volume exists - {{gvol_name}} > gluster_volume: > > state=present > name={{gvol_name}} > brick={{gvol_brick}} > options="{ group: virt, storage.owner-uid: '36', storage.owner-gid: > '36' }" > > Unfortunately, that syntax still fails with msg: unable to evaluate > dictionary for options. > > Do you have any tips on the fix or are you able to send a working > role/playbook that I can use as an example? > > Either way, I appreciate you posting your fault and some success online! > :) > > > > On Saturday, July 4, 2015 at 3:52:09 PM UTC+12, Michael Goodness wrote: >> >> Well, apparently I hadn't tried everything yet. I was able to get a >> successful run by including the options parameter in the creation task, >> rather than keeping them separate. I also had to double-quote the expansion >> in my playbook, and single-quote the integers in my variable dictionary: >> >> # file: group_vars/gluster_hosts >>> ... >>> options: { group: virt, storage.owner-uid: '36', storage.owner-gid: '36' >>> } >>> ... >> >> >> (Note the corrections to owner-uid and owner-gid.) >> >> # file: roles/gluster/tasks/main.yml >>> ... >>> - name: Create gluster volumes >>> sudo: true >>> gluster_volume: >>> name={{ item.name }} >>> brick="{% for brick in item.bricks %}{{ brick.mount }}/{{ item.name >>> }}{% if not loop.last %},{% endif %}{% endfor %}" >>> cluster="{{ groups.gluster_hosts|join(',') }}" >>> options="{{ item.options }}" >>> state=present >>> with_items: gluster_volumes >>> tags: gluster >>> ... >> >> >> Seems like there's a bug in the module, and the documentation is >> definitely incorrect. I'll experiment more and see if I can offer a fix. >> >> >> On Friday, July 3, 2015 at 10:33:24 PM UTC-5, Michael Goodness wrote: >>> >>> Greetings, Ansiblites! >>> >>> I'm attempting to write a role that uses the gluster_volume module. All >>> is well right up until I try to specify an 'options' parameter. According >>> to the documentation, I'm to use "a dictionary/hash with >>> options/settings for the volume". The example given is as follows: >>> >>> gluster_volume: state=present name=test1 >>>> options='{performance.cache-size: 256MB}' >>> >>> >>> I've matched that syntax in my playbook, and all I get is a complaint >>> from Ansible about quoting. I've tried just about every variation of >>> quoting I can think of: single, double, double-double, escaped, etc.. The >>> closest I (think) have gotten is by specifying the options as a variable, >>> then single-quoting the expansion: >>> >>> # file: group_vars/gluster_hosts >>>> ... >>>> options: { group: virt, storage.owner_uid: 36, storage.owner_gui: 36 } >>>> ... >>>> >>> >>> >>>> # file: roles/gluster/tasks/main.yml >>>> ... >>>> gluster_volume: name={{ name }} options='{{ options }}' state=present >>>> ... >>> >>> >>> Even then, the result is: >>> >>> msg: unable to evaluate dictionary for options >>> >>> >>> Can anyone shed some light on this? I'm at my wit's end. >>> >> -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ansible-project/HBYeLDc4PJc/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/d0ee360f-69c6-4394-ae8e-0c7c9a4591d1%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/d0ee360f-69c6-4394-ae8e-0c7c9a4591d1%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CANNfWz%3DUCzZOWbYJMvREDVtz7xyAK4u73EvVNY8CJ_YcVQfHgg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
