---
# CentOS related tasks

- name: Selinux... enable seboolean settings
  seboolean:
    name: "{{ item }}"
    state: yes 
    persistent: yes 
  with_items:
    - virt_sandbox_use_fusefs
    - virt_use_fusefs

- name: Install glusterfs repo
  dnf:
    name: centos-release-gluster9

- name: As the repo list and url is not available anymore, let's change the content
  copy:
    dest: "/etc/yum.repos.d/CentOS-Gluster-9.repo"
    src: files/CentOS-Gluster-9.repo
    owner: "root"
    group: "root"
    mode: 0640

- name: Install glusterfs packages and requirements
  dnf:
    #name: ['glusterfs-server', 'samba', 'nfs-utils']
    name: glusterfs-server

    #- name: permit traffic in default zone for services
    #  firewalld:
    #    service: "{{ item }}"
    #    permanent: yes
    #    state: enabled
    #  with_items:
    #    - nfs
    #    - samba
    #    - samba-client
    #
    #- name: traffic in default zone on ports
    #  firewalld:
    #    port: "{{ item }}"
    #    permanent: yes
    #    state: enabled
    #  with_items:
    #    - "111/tcp"
    #    - "139/tcp"
    #    - "445/tcp"
    #    - "965/tcp"
    #    - "2049/tcp"
    #    - "38465-38469/tcp"
    #    - "631/tcp"
    #    - "24007-24008/tcp"
    #    - "24009/tcp"
    #    - "111/udp"
    #    - "963/udp"
    #    - "49152-49251/tcp"

- name: GlusterFS Installed Starting
  service:
    name: glusterd
    state: started
    enabled: yes 
