---

- name: Install glusterfs client
  action: apt name=glusterfs-client state=installed update_cache=yes
  when: is_debian_or_ubuntu
  tags:
    - gluster

- name: Install glusterfs packages (CentOS)
  action: yum name={{item}} state=installed
  with_items:
    - glusterfs-client
  when: is_centos
  tags:
    - gluster

- name: Create mountpoint
  action: file path=/glusterfs state=directory
  tags:
    - gluster

- name: Mount the glusterfs filesystem
  action: mount name=/glusterfs fstype=glusterfs src={{groups.gluster_data[0]}}:{{gluster_volume}} state=mounted
  tags:
    - gluster
