1

I wrote some roles for my home lab to setup a GlusterFS cluster.

But when I run it on my 2 nodes, some tasks get executed over and over again and it seems that it never ends.

Here is the log output (I cut it off at some point and also removed a lot of the * characters)

 ✘ user@pc  ~/ansible   feature/role-gluster  ansible-playbook -i inventories/playground/hosts.yaml site.yml -K
BECOME password: 

PLAY [storageservers] ******************

TASK [Gathering Facts] *****************
ok: [node2]
ok: [node1]

TASK [include_role : gluster-node] *****

TASK [include_role : gluster-node-partition] 

TASK [include_role : gluster-node-partition] 

TASK [gluster-node-partition : Create data1 partition] 
changed: [node2]
changed: [node1]

TASK [gluster-node-partition : Create filesystem on data1 partition] 
changed: [node2]
changed: [node1]

TASK [gluster-node-partition : Create mount point for data1 partition] 
changed: [node1]
changed: [node2]

TASK [gluster-node-partition : Mount data1 partition] *
changed: [node2]
changed: [node1]

TASK [Create data1 partition] **********

TASK [gluster-node-partition : Create data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create filesystem on data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data1 partition] *
ok: [node1]
ok: [node2]

TASK [Create data2 partition] **********

TASK [gluster-node-partition : Create data2 partition] 
changed: [node1]
changed: [node2]

TASK [gluster-node-partition : Create filesystem on data2 partition] 
changed: [node2]
changed: [node1]

TASK [gluster-node-partition : Create mount point for data2 partition] 
changed: [node1]
changed: [node2]

TASK [gluster-node-partition : Mount data2 partition] *
changed: [node1]
changed: [node2]

TASK [Create data3 partition] **********

TASK [gluster-node-partition : Create data3 partition] 
changed: [node2]
changed: [node1]

TASK [gluster-node-partition : Create filesystem on data3 partition] 
changed: [node1]
changed: [node2]

TASK [gluster-node-partition : Create mount point for data3 partition] 
changed: [node1]
changed: [node2]

TASK [gluster-node-partition : Mount data3 partition] *
changed: [node1]
changed: [node2]

TASK [gluster-node : Update apt-get repo and cache] ***
ok: [node2]
ok: [node1]

TASK [gluster-node : Upgrade all apt packages] ********
changed: [node2]

changed: [node1]

TASK [gluster-node : Install GlusterFS] 
changed: [node2]
changed: [node1]

TASK [gluster-node : Enable GlusterFS on Boot] ********
changed: [node2]
changed: [node1]

TASK [gluster-node : Probe GlusterFS Nodes] *
changed: [node1] => (item=node1)
changed: [node2] => (item=node1)
changed: [node1] => (item=node2)
changed: [node2] => (item=node2)

TASK [gluster-node : Ensure Gluster brick and mount directories exist.] 
changed: [node1] => (item=/data1)
changed: [node2] => (item=/data1)
changed: [node1] => (item=/gluster_volume1)
changed: [node2] => (item=/gluster_volume1)

TASK [gluster-node : Configure Gluster volume.] *******
changed: [node1]

TASK [gluster-node : Ensure Gluster volume is mounted.] *************
changed: [node1]
changed: [node2]

TASK [include_role : gluster-node-partition] 

TASK [include_role : gluster-node-partition] 

TASK [gluster-node-partition : Create data1 partition] 
ok: [node2]
ok: [node1]

TASK [gluster-node-partition : Create filesystem on data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data1 partition] *
ok: [node1]
ok: [node2]

TASK [Create data1 partition] **********

TASK [gluster-node-partition : Create data1 partition] 
ok: [node2]
ok: [node1]

TASK [gluster-node-partition : Create filesystem on data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data1 partition] *
ok: [node1]
ok: [node2]

TASK [Create data2 partition] **********

TASK [gluster-node-partition : Create data2 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create filesystem on data2 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data2 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data2 partition] *
ok: [node1]
ok: [node2]

TASK [Create data3 partition] **********

TASK [gluster-node-partition : Create data3 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create filesystem on data3 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data3 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data3 partition] *
ok: [node1]
ok: [node2]

TASK [Create default partitioning] *****

TASK [Create gluster volume for partition 1] 

TASK [include_role : gluster-node] *****

TASK [include_role : gluster-node-partition] 

TASK [include_role : gluster-node-partition] 

TASK [gluster-node-partition : Create data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create filesystem on data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data1 partition] *
ok: [node1]
ok: [node2]

TASK [Create data1 partition] **********

TASK [gluster-node-partition : Create data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create filesystem on data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data1 partition] *
ok: [node1]
ok: [node2]

TASK [Create data2 partition] **********

TASK [gluster-node-partition : Create data2 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create filesystem on data2 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data2 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data2 partition] *
ok: [node1]
ok: [node2]

TASK [Create data3 partition] **********

TASK [gluster-node-partition : Create data3 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create filesystem on data3 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data3 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data3 partition] *
ok: [node1]
ok: [node2]

TASK [gluster-node : Update apt-get repo and cache] ***
ok: [node1]
ok: [node2]

TASK [gluster-node : Upgrade all apt packages] ********
ok: [node1]
ok: [node2]

TASK [gluster-node : Install GlusterFS] 
ok: [node1]
ok: [node2]

TASK [gluster-node : Enable GlusterFS on Boot] ********
ok: [node1]
ok: [node2]

TASK [gluster-node : Probe GlusterFS Nodes] *
changed: [node1] => (item=node1)
changed: [node2] => (item=node1)
changed: [node2] => (item=node2)
changed: [node1] => (item=node2)

TASK [gluster-node : Ensure Gluster brick and mount directories exist.] 
ok: [node1] => (item=/data1)
ok: [node2] => (item=/data1)
ok: [node1] => (item=/gluster_volume1)
ok: [node2] => (item=/gluster_volume1)

TASK [gluster-node : Configure Gluster volume.] *******
ok: [node1]

TASK [gluster-node : Ensure Gluster volume is mounted.] *************
ok: [node1]
ok: [node2]

TASK [include_role : gluster-node-partition] 

TASK [include_role : gluster-node-partition] 

TASK [gluster-node-partition : Create data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create filesystem on data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data1 partition] *
ok: [node1]
ok: [node2]

TASK [Create data1 partition] **********

TASK [gluster-node-partition : Create data1 partition] 
ok: [node2]
ok: [node1]

TASK [gluster-node-partition : Create filesystem on data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data1 partition] *
ok: [node1]
ok: [node2]

TASK [Create data2 partition] **********

TASK [gluster-node-partition : Create data2 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create filesystem on data2 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data2 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data2 partition] *
ok: [node1]
ok: [node2]

TASK [Create data3 partition] **********

TASK [gluster-node-partition : Create data3 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create filesystem on data3 partition] 
ok: [node2]
ok: [node1]

TASK [gluster-node-partition : Create mount point for data3 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data3 partition] *
ok: [node1]
ok: [node2]

TASK [Create default partitioning] *****

TASK [Create gluster volume for partition 1] 

TASK [include_role : gluster-node] *****

TASK [include_role : gluster-node-partition] 

TASK [include_role : gluster-node-partition] 

TASK [gluster-node-partition : Create data1 partition] 
ok: [node2]
ok: [node1]

TASK [gluster-node-partition : Create filesystem on data1 partition] 
ok: [node2]
ok: [node1]

TASK [gluster-node-partition : Create mount point for data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data1 partition] *
ok: [node2]
ok: [node1]

TASK [Create data1 partition] **********

TASK [gluster-node-partition : Create data1 partition] 
ok: [node2]
ok: [node1]

TASK [gluster-node-partition : Create filesystem on data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data1 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data1 partition] *
ok: [node1]
ok: [node2]

TASK [Create data2 partition] **********

TASK [gluster-node-partition : Create data2 partition] 
ok: [node2]
ok: [node1]

TASK [gluster-node-partition : Create filesystem on data2 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data2 partition] 
ok: [node2]
ok: [node1]

TASK [gluster-node-partition : Mount data2 partition] *
ok: [node1]
ok: [node2]

TASK [Create data3 partition] **********

TASK [gluster-node-partition : Create data3 partition] 
ok: [node2]
ok: [node1]

TASK [gluster-node-partition : Create filesystem on data3 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Create mount point for data3 partition] 
ok: [node1]
ok: [node2]

TASK [gluster-node-partition : Mount data3 partition] *
ok: [node1]
ok: [node2]

TASK [gluster-node : Update apt-get repo and cache] ***
ok: [node1]
ok: [node2]

TASK [gluster-node : Upgrade all apt packages] ********
ok: [node1]
ok: [node2]

TASK [gluster-node : Install GlusterFS] 
ok: [node1]
ok: [node2]

TASK [gluster-node : Enable GlusterFS on Boot] 
ok: [node1]
ok: [node2]

TASK [gluster-node : Probe GlusterFS Nodes] 
changed: [node1] => (item=node1)
changed: [node2] => (item=node1)
changed: [node1] => (item=node2)
changed: [node2] => (item=node2)

TASK [gluster-node : Ensure Gluster brick and mount directories exist.] 
ok: [node1] => (item=/data1)
ok: [node2] => (item=/data1)
ok: [node1] => (item=/gluster_volume1)
ok: [node2] => (item=/gluster_volume1)

TASK [gluster-node : Configure Gluster volume.] 
ok: [node1]


^C [ERROR]: User interrupted execution

I placed all the code here: https://github.com/CodingSpiderFox/ansible-loop-problem

1

I commited the fix to the Github repo. The problem was that a role was included recursively.

I split up the roles a bit to fix it. Also discovered a lot of other issues with repeated task executions (not all of the fixed yet because I'm still learning how to structure my ansible tasks)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.