# New module: GlusterFS

**URL:** <https://forum.ansible.com/t/new-module-glusterfs/16087>\
**Category:** Ansible Developer\
**Created:** [August 31, 2014, 10:17am UTC](https://forum.ansible.com/t/new-module-glusterfs/16087 "2014-08-31T10:17:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taneli\_Leppa](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@Taneli\_Leppa](https://forum.ansible.com/u/Taneli_Leppa)\
**Post date:** [August 31, 2014, 10:17am UTC](https://forum.ansible.com/t/new-module-glusterfs/16087/1 "2014-08-31T10:17:29Z")

</div>

Hello,

I didn’t find any glusterfs modules for Ansible, so I wrote my own: [https://github.com/rosmo/ansible-glusterfs](https://github.com/rosmo/ansible-glusterfs)

-Taneli

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [August 31, 2014, 5:54pm UTC](https://forum.ansible.com/t/new-module-glusterfs/16087/2 "2014-08-31T17:54:23Z")

</div>

This looks pretty good, but this is problematic (in def run\_gluster\_yes(gargs)):

cmdline = 'echo y | ’ + ’ '.join(args)  
rc, out, err = module.run\_command(cmdline, use\_unsafe\_shell=True)

You’re allowing unsafe shell commands in with user-input, which is a security violation. The module overall looks really good, but if you want to contribute this to core (which we’d be open to), you’ll need to rework the above. Simply using module.run\_command(cmdline, data=‘y\n’) should do the same thing.

---

<div class="post-metadata">

**Author:** ![Taneli\_Leppa](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@Taneli\_Leppa](https://forum.ansible.com/u/Taneli_Leppa)\
**Post date:** [September 1, 2014, 4:46am UTC](https://forum.ansible.com/t/new-module-glusterfs/16087/3 "2014-09-01T04:46:16Z")

</div>

Hello James,

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [September 1, 2014, 12:05pm UTC](https://forum.ansible.com/t/new-module-glusterfs/16087/4 "2014-09-01T12:05:10Z")

</div>

Yes, absolutely, just send us a PR.

Thanks!

---

<div class="post-metadata">

**Author:** ![Deepak\_Shetty](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Deepak\_Shetty](https://forum.ansible.com/u/Deepak_Shetty)\
**Post date:** [November 24, 2014, 12:27pm UTC](https://forum.ansible.com/t/new-module-glusterfs/16087/5 "2014-11-24T12:27:21Z")

</div>

Hi, whats the latest on this ? Has this module been added to the core ?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [November 24, 2014, 10:53pm UTC](https://forum.ansible.com/t/new-module-glusterfs/16087/6 "2014-11-24T22:53:26Z")

</div>

there are no submissions I’m aware of.

Please feel free to work on one, though it seems like it may be more apt to be a role than a module – Ansible Galaxy may be appropriate.

---

<div class="post-metadata">

**Author:** ![Deepak\_Shetty](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Deepak\_Shetty](https://forum.ansible.com/u/Deepak_Shetty)\
**Post date:** [November 25, 2014, 5:01am UTC](https://forum.ansible.com/t/new-module-glusterfs/16087/7 "2014-11-25T05:01:32Z")

</div>

Hi Michael,

I am fairly new to ansible, so just to understand your point better, why does it seem more appropriate to be a role than a module ?  
Is it because it support multiple operations like create, set tunables, etc each of which is a separate playbook ? Right now it seems  
like its just one .yaml hence 1 playbook.

I am looking at using ansible as a glue layer between openstack Manila on one side(frontend) and gluster trusted storage pool on the other side (backend)

Googling, i found this and it seems it might have the stuff i need, just that its not complete, hence I am interested in this and more interested to know

what to develop, module, playbook, role… a bit confused even after reading ansible docs 🙂

thanx,  
deepak

---

<div class="post-metadata">

**Author:** ![Neependra\_Khare](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@Neependra\_Khare](https://forum.ansible.com/u/Neependra_Khare)\
**Post date:** [February 27, 2015, 1:49pm UTC](https://forum.ansible.com/t/new-module-glusterfs/16087/8 "2015-02-27T13:49:14Z")

</div>

> Hello,
> 
> I didn’t find any glusterfs modules for Ansible, so I wrote my own: [https://github.com/rosmo/ansible-glusterfs](https://github.com/rosmo/ansible-glusterfs)

I am trying ansible 1.9  
and when I try to create volume I get following error

msg: this module requires key=value arguments ([‘state=present’, ‘name=test1’, ‘brick=/bricks/b01’, ‘rebalance=yes’, “hosts:[‘host1’, ‘host2’, ‘host3’, ‘host4’]”])

I am using following task to create volume.

- name: Create volume  
gluster\_volume: state=present name=test1 brick=/bricks/b01 rebalance=yes hosts:“{{ groups.master }}”  
run\_once: true

Thanks,  
Neependra

---

<div class="post-metadata">

**Author:** ![Ian\_Levesque](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@Ian\_Levesque](https://forum.ansible.com/u/Ian_Levesque)\
**Post date:** [February 27, 2015, 2:10pm UTC](https://forum.ansible.com/t/new-module-glusterfs/16087/9 "2015-02-27T14:10:53Z")

</div>

If you have a colon in your statement, you need to double-quote it. See [http://docs.ansible.com/YAMLSyntax.html#gotchas](http://docs.ansible.com/YAMLSyntax.html#gotchas)

~irl

---

<div class="post-metadata">

**Author:** ![Neependra\_Khare](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@Neependra\_Khare](https://forum.ansible.com/u/Neependra_Khare)\
**Post date:** [February 27, 2015, 2:28pm UTC](https://forum.ansible.com/t/new-module-glusterfs/16087/10 "2015-02-27T14:28:57Z")

</div>

> > > Hello,
> > > 
> > > I didn't find any glusterfs modules for Ansible, so I wrote my own:  
> > > [https://github.com/rosmo/ansible-glusterfs](https://github.com/rosmo/ansible-glusterfs)
> > 
> > I am trying ansible 1.9  
> > and when I try to create volume I get following error
> > 
> > msg: this module requires key=value arguments (['state=present',  
> > 'name=test1', 'brick=/bricks/b01', 'rebalance=yes', "hosts:['host1',  
> > 'host2', 'host3', 'host4']"])
> > 
> > I am using following task to create volume.
> > 
> > - name: Create volume  
> > &nbsp;&nbsp;gluster\_volume: state=present name=test1 brick=/bricks/b01  
> > rebalance=yes hosts:"{{ groups.master }}"  
> > &nbsp;&nbsp;run\_once: true
> 
> If you have a colon in your statement, you need to double-quote it. See  
> [http://docs.ansible.com/YAMLSyntax.html#gotchas](http://docs.ansible.com/YAMLSyntax.html#gotchas)

I am doing above  
hosts:"{{ groups.master }}"

Am I missing something ?

Thanks
