ansible-dockerswarm: Getting fatal error on `Get list of labels.` task
The task Get list of labels.
is failing after updated with ansible_fqdn
on https://github.com/atosatto/ansible-dockerswarm/commit/3bb8a49297448325b8feaa9b7a899c78b2fab97e
The node hostname(staging-manager-03
) on docker node ls
is different from the fqdn string given on following error:
TASK [atosatto.docker-swarm : Get list of labels.] ********************************************************************************************************************************************
fatal: [165.22.48.107 -> 165.22.48.105]: FAILED! => {"changed": false, "cmd": ["docker", "inspect", "--format", "{{ range $key, $value := .Spec.Labels }}{{ printf \"%s\\n\" $key }}{{ end }}", "staging-manager-03.sgp1"], "delta": "0:00:00.412684", "end": "2020-05-14 13:10:42.573599", "msg": "non-zero return code", "rc": 1, "start": "2020-05-14 13:10:42.160915", "stderr": "Error: No such object: staging-manager-03.sgp1", "stderr_lines": ["Error: No such object: staging-manager-03.sgp1"], "stdout": "", "stdout_lines": []}
For now I am using v2.2.0 which gives no error.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 9
- Comments: 19 (1 by maintainers)
Commits related to this issue
- Revert commit 3bb8a49 mentioned in upstream issue #78 to fix cluster setup — committed to juanluisbaptiste/ansible-dockerswarm by juanluisbaptiste 4 years ago
- Revert commit 3bb8a49 mentioned in upstream issue #78 to fix cluster setup — committed to juanluisbaptiste/ansible-dockerswarm by juanluisbaptiste 4 years ago
I can confirm that the commit 3bb8a49 mentioned in the issue #82 is the one that breaks the labels setup, if it is reverted then the playbook finishes without issues.
Hello. I’m also having this issue. Any plans to reaply the fix? Thanks!
Workaround for me was: replace
{{ ansible_fqdn|lower }}
on{{ ansible_hostname }}
and from the hostname remove all dots. Wasnode1.connect
becomenode1connect
I have the same issue except for ‘ambigious’ instead of not found.
TASK [atosatto.docker-swarm : Get list of labels.] ******************************************************************************************************************************************* fatal: [asus.yi -> None]: FAILED! => {"changed": false, "cmd": ["docker", "inspect", "--format", "{{ range $key, $value := .Spec.Labels }}{{ printf \"%s\\n\" $key }}{{ end }}", "host.domain"], " delta": "0:00:00.335281", "end": "2020-05-15 22:58:12.700418", "msg": "non-zero return code", "rc": 1, "start": "2020-05-15 22:58:12.365137", "stderr": "Error response from daemon: node host.domain is ambiguous (2 matches found)", "stderr_lines": ["Error response from daemon: node host.domain is ambiguous (2 matches found)"], "stdout": "", "stdout_lines": []}
Edit: Workaround for me was simply making the node leave. ‘docker swarm leave --force’.