New module: GlusterFS

Hello,

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

-Taneli

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.

Hello James,

Yes, absolutely, just send us a PR.

Thanks!

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

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.

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 :slight_smile:

thanx,
deepak

Hello,

I didn’t find any glusterfs modules for Ansible, so I wrote my own: 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

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

~irl

Hello,

I didn't find any glusterfs modules for Ansible, so I wrote my own:
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

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

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

Am I missing something ?

Thanks