---
- name: Open firewall ports for GlusterFS
  hosts: oo_glusterfs_to_config
  vars:
    os_firewall_allow:
    - service: glusterfs_sshd
      port: "2222/tcp"
    - service: glusterfs_daemon
      port: "24007/tcp"
    - service: glusterfs_management
      port: "24008/tcp"
    - service: glusterfs_bricks
      port: "49152-49251/tcp"
  roles:
  - role: os_firewall
    when:
    - openshift_storage_glusterfs_is_native | default(True)

- name: Configure GlusterFS
  hosts: oo_first_master
  roles:
  - role: openshift_storage_glusterfs
    when: groups.oo_glusterfs_to_config | default([]) | count > 0
