Skip to content

Task fails to Create a Cluster - no bricks specified, even though I did #29

Description

@Cloufish

I have following task:

- name: Create Gluster Volume (on first node)
  when: inventory_hostname == groups['gluster_nodes'][0]
  run_once: true
  gluster_volume: 
    state: present
    name: "{{gluster_volume_name}}"
    bricks: "{{groups['gluster_nodes'][0]}}:{{gluster_volume_path}}/{{groups['gluster_nodes'][0]}}/brick,{{groups['gluster_nodes'][1]}}:{{gluster_volume_path}}/{{groups['gluster_nodes'][1]}}/brick,{{groups['gluster_nodes'][2]}}:{{gluster_volume_path}}/{{groups['gluster_nodes'][2]}}/brick"
    replicas: 3
    force: yes 
    options:
      performance.cache-size: 128MB,
      auth.allow: "{{groups['gluster_nodes'][0]}},{{groups['gluster_nodes'][1]}},{{groups['gluster_nodes'][2]}}"
      auth.ssl-allow:  "{{groups['gluster_nodes'][0]}},{{groups['gluster_nodes'][1]}},{{groups['gluster_nodes'][2]}}"
      ssl.cipher-list: 'HIGH:!SSLv2:!SSLv3'
      client.ssl: 'on'
      server.ssl: 'on' 

But I get following error (verbose output):

TASK [gluster : Create Gluster Volume (on first node)] *************************
task path: /home/cloufish/Projects/Ansible-HomeLab/playbooks/swarm/roles/gluster/tasks/init.yml:25
Wednesday 22 March 2023  14:47:18 +0100 (0:00:00.061)       0:00:11.626 ******* 
Wednesday 22 March 2023  14:47:18 +0100 (0:00:00.061)       0:00:11.625 ******* 
redirecting (type: modules) ansible.builtin.gluster_volume to gluster.gluster.gluster_volume
redirecting (type: modules) ansible.builtin.gluster_volume to gluster.gluster.gluster_volume
Using module file /home/cloufish/.ansible/collections/ansible_collections/gluster/gluster/plugins/modules/gluster_volume.py
Pipelining is enabled.
<192.168.1.130> ESTABLISH SSH CONNECTION FOR USER: root
<192.168.1.130> SSH: EXEC ssh -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/home/cloufish/.ssh/ansible_ed25519"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o 'ControlPath="/home/cloufish/.ansible/cp/9633dff9ae"' 192.168.1.130 '/bin/sh -c '"'"'/usr/bin/python3 && sleep 0'"'"''
<192.168.1.130> (1, b'\n{"exception": "NoneType: None\\n", "failed": true, "msg": "error running gluster (/usr/sbin/gluster --mode=script volume create gfs replica 3 transport tcp force) command (rc=1): No bricks specified\\n\\nUsage:\\nvolume create <NEW-VOLNAME> [[replica <COUNT> [arbiter <COUNT>]]|[replica 2 thin-arbiter 1]] [disperse [<COUNT>]] [disperse-data <COUNT>] [redundancy <COUNT>] [transport <tcp|rdma|tcp,rdma>] <NEW-BRICK> <TA-BRICK>... [force]\\n\\n", "invocation": {"module_args": {"state": "present", "name": "gfs", "bricks": "192.168.1.130:/data/gluster/192.168.1.130/brick,192.168.1.131:/data/gluster/192.168.1.131/brick,192.168.1.132:/data/gluster/192.168.1.132/brick", "replicas": 3, "force": true, "options": {"performance.cache-size": "128MB,", "auth.allow": "192.168.1.130,192.168.1.131,192.168.1.132", "auth.ssl-allow": "192.168.1.130,192.168.1.131,192.168.1.132", "ssl.cipher-list": "HIGH:!SSLv2:!SSLv3", "client.ssl": "on", "server.ssl": "on"}, "transport": "tcp", "start_on_create": true, "rebalance": false, "cluster": null, "host": null, "stripes": null, "arbiters": null, "disperses": null, "redundancies": null, "quota": null, "directory": null}}}\n', b'')
<192.168.1.130> Failed to connect to the host via ssh: 
The full traceback is:
NoneType: None
fatal: [192.168.1.130]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "arbiters": null,
            "bricks": "192.168.1.130:/data/gluster/192.168.1.130/brick,192.168.1.131:/data/gluster/192.168.1.131/brick,192.168.1.132:/data/gluster/192.168.1.132/brick",
            "cluster": null,
            "directory": null,
            "disperses": null,
            "force": true,
            "host": null,
            "name": "gfs",
            "options": {
                "auth.allow": "192.168.1.130,192.168.1.131,192.168.1.132",
                "auth.ssl-allow": "192.168.1.130,192.168.1.131,192.168.1.132",
                "client.ssl": "on",
                "performance.cache-size": "128MB,",
                "server.ssl": "on",
                "ssl.cipher-list": "HIGH:!SSLv2:!SSLv3"
            },
            "quota": null,
            "rebalance": false,
            "redundancies": null,
            "replicas": 3,
            "start_on_create": true,
            "state": "present",
            "stripes": null,
            "transport": "tcp"
        }
    },
    "msg": "error running gluster (/usr/sbin/gluster --mode=script volume create gfs replica 3 transport tcp force) command (rc=1): No bricks specified\n\nUsage:\nvolume create <NEW-VOLNAME> [[replica <COUNT> [arbiter <COUNT>]]|[replica 2 thin-arbiter 1]] [disperse [<COUNT>]] [disperse-data <COUNT>] [redundancy <COUNT>] [transport <tcp|rdma|tcp,rdma>] <NEW-BRICK> <TA-BRICK>... [force]\n\n"
}

Just for testing purposes, I changes brick to brick: /data/gluster, but the same error occured

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions