Skip to content

Commit

Permalink
Revert commit 3bb8a49 mentioned in upstream issue atosatto#78 to fix …
Browse files Browse the repository at this point in the history
…cluster setup
  • Loading branch information
juanluisbaptiste committed May 20, 2021
1 parent 84763cf commit 5c6a949
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tasks/setup-swarm-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
command: >-
docker inspect
--format {% raw %}'{{ range $key, $value := .Spec.Labels }}{{ printf "%s\n" $key }}{{ end }}'{% endraw %}
{{ ansible_fqdn|lower }}
{{ ansible_hostname }}
register: docker_swarm_labels
changed_when: false
delegate_to: "{{ groups['docker_swarm_manager'][0] }}"
Expand All @@ -13,7 +13,7 @@
- swarm_labels

- name: Remove labels from swarm node.
command: docker node update --label-rm {{ item }} {{ ansible_fqdn|lower }}
command: docker node update --label-rm {{ item }} {{ ansible_hostname }}
with_items: "{{ docker_swarm_labels.stdout_lines }}"
when: swarm_labels is defined and item not in swarm_labels
delegate_to: "{{ groups['docker_swarm_manager'][0] }}"
Expand All @@ -22,7 +22,7 @@
- swarm_labels

- name: Assign labels to swarm nodes if any.
command: docker node update --label-add {{ item }}=true {{ ansible_fqdn|lower }}
command: docker node update --label-add {{ item }}=true {{ ansible_hostname }}
when: item not in docker_swarm_labels.stdout_lines
with_items:
- "{{ swarm_labels | default([]) }}"
Expand Down

0 comments on commit 5c6a949

Please sign in to comment.