---
  # Install packages
  - name: add EPEL repository
    yum:
      name: http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
      state: present
    when: ansible_os_family == 'RedHat'
  - name: add Gluster yum repository
    yum_repository:
      name: gluster
      description: Gluster 3.8
      baseurl: "http://buildlogs.centos.org/centos/7/storage/x86_64/gluster-3.8/"
      gpgcheck: no
    when: ansible_os_family == 'RedHat'
  - name: add Gluster deb repository
    apt_repository:
      repo: ppa:gluster/glusterfs-3.8
      update_cache: yes
    when: ansible_os_family == 'Debian'
  - name: install glusterfs-server package
    package:
      name: "glusterfs-server{{glusterfs_server_version}}"
      state: present
  # TODO remove when included in packages
  - name: install nfs-common package
    apt:
      name: nfs-common
      state: latest
    when: ansible_os_family == 'Debian'
  - name: install nfs-utils package
    yum:
      name: nfs-utils
      state: latest
    when: ansible_os_family == 'RedHat'

---
  # Install packages
  - name: add EPEL repository
    yum:
      name: http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
      state: present
    when: ansible_os_family == 'RedHat'
  - name: add Gluster yum repository
    yum_repository:
      name: gluster
      description: Gluster 3.8
      baseurl: "http://buildlogs.centos.org/centos/7/storage/x86_64/gluster-3.8/"
      gpgcheck: no
    when: ansible_os_family == 'RedHat'
  - name: add Gluster deb repository
    apt_repository:
      repo: ppa:gluster/glusterfs-3.8
      update_cache: yes
    when: ansible_os_family == 'Debian'
  - name: install glusterfs-server package
    package:
      name: "glusterfs-server{{glusterfs_server_version}}"
      state: present
Remove nfs pkg installation from gluster play
Remove nfs pkg installation from gluster play
