Open
Description
The scenario:
- gluster_volume is correctly configured across an ansible group
- one of the group's peer disconnects permanently (cluster scaled down in our case)
- run gluster_volume ansible without the disconnected peer in the group
Expected result
gluster_volume
task automatically removes the bricks from the disconnected peer
Real behaviour
- it fails with
ValueError: invalid literal for int() with base 10
.
Reason
The problem is on the line 430 in gluster_volume.py:
gluster-ansible-collection/plugins/modules/gluster_volume.py
Lines 426 to 431 in 3b3d406
Because it expects output from gluster volume heal [name] info
like this:
Brick 10.10.1.102:/opt/volume
Status: Connected
Number of entries: 0
But in case the peer disconnected, the output is
Brick 10.10.1.102:/opt/volume
Status: Transport endpoint is not connected
Number of entries: -
So the condition on line 430 fails, because ' -' is not an int.
Task used:
- name: Configure Gluster volume.
gluster_volume:
state: present
name: "{{ brick_name }}"
brick: "{{ brick_dir }}"
replicas: "{{ groups[gluster_group] | length }}"
cluster: "{{ groups[gluster_group] | map('extract', hostvars, 'ansible_all_ipv4_addresses') | map('select', 'search', '^10\\.') | map('first') | list }}"
host: "{{ ansible_all_ipv4_addresses | select('search', '^10\\.') | first }}"
force: yes
run_once: true
Metadata
Metadata
Assignees
Labels
No labels