gluster / gluster-ansible-infra

Ansible role to enable and deploy the backend of a Gluster cluster.
GNU General Public License v3.0
28 stars 36 forks source link

gluster.infra package throwing error for firewall_config #117

Open rkothiya opened 3 years ago

rkothiya commented 3 years ago

While trying to run the perf test on Fedora33 servers, I am getting the following error :

TASK [gluster.infra/roles/firewall_config : Add/Delete services to firewalld rules] ****************************************************************************************
failed: [server1.example.com] (item=glusterfs) => {"ansible_loop_var": "item", "changed": false, "item": "glusterfs", "msg": "ERROR: Exception caught: org.fedoraproject.FirewallD1.Exception: INVALID_SERVICE: glusterfs Permanent and Non-Permanent(immediate) operation, Services are defined by port/tcp relationship and named as they are in /etc/services (on most systems)"}
failed: [server2.example.com] (item=glusterfs) => {"ansible_loop_var": "item", "changed": false, "item": "glusterfs", "msg": "ERROR: Exception caught: org.fedoraproject.FirewallD1.Exception: INVALID_SERVICE: glusterfs Permanent and Non-Permanent(immediate) operation, Services are defined by port/tcp relationship and named as they are in /etc/services (on most systems)"}
failed: [server3.example.com] (item=glusterfs) => {"ansible_loop_var": "item", "changed": false, "item": "glusterfs", "msg": "ERROR: Exception caught: org.fedoraproject.FirewallD1.Exception: INVALID_SERVICE: glusterfs Permanent and Non-Permanent(immediate) operation, Services are defined by port/tcp relationship and named as they are in /etc/services (on most systems)"}
failed: [server5.example.com] (item=glusterfs) => {"ansible_loop_var": "item", "changed": false, "item": "glusterfs", "msg": "ERROR: Exception caught: org.fedoraproject.FirewallD1.Exception: INVALID_SERVICE: glusterfs Permanent and Non-Permanent(immediate) operation, Services are defined by port/tcp relationship and named as they are in /etc/services (on most systems)"}
ok: [server2.example.com] => (item=samba)
ok: [server1.example.com] => (item=samba)
ok: [server3.example.com] => (item=samba)
ok: [server5.example.com] => (item=samba)

Control machine is having the following packages install :

rpm -qa | grep gluster

gluster-ansible-maintenance-1.0.1-10.el7.noarch gluster-ansible-cluster-1.0.1-2.el7.noarch gluster-ansible-1.0.5-1.el7.noarch centos-release-gluster7-1.0-2.el7.centos.noarch gluster-ansible-infra-1.0.4-15.el7.noarch gluster-ansible-repositories-1.0.1-3.el7.noarch gluster-ansible-features-1.0.5-6.el7.noarch

The server on which the ansible script is running is having fedora33 installed

pkesavap commented 3 years ago

@rkothiya Did you find any work around for this?

pkesavap commented 3 years ago

@rkothiya did you by any chance manually install glusterfs-server as part of the workaround

hunter86bg commented 3 years ago

Glusterfs-server and in some distros reload of firewalld is needed I'm using in Ubuntu 20.04 the following (omitting the code for swapping from UFW to firewalld):

# tasks file for firewall_config
- name: Populate service facts
  ansible.builtin.service_facts:

- name: Install gluster-server to get the firewalld service
  package:
    name: 'glusterfs-server'
    state: present
  register: install_status
  when:
  - 'gluster_infra_fw_services is defined'
  - 'services["ufw.service"].status == "masked"'

- name: Reload firewalld before enabling glusterfs service
  service:
    name: firewalld
    state: reloaded
  when:
  - 'gluster_infra_fw_services is defined'
  - 'services["ufw.service"].status == "masked"'
  - 'install_status.changed'

- name: Add/Delete services to firewalld rules
<output truncated>