Use a shell command to manage the node labels
This commit is contained in:
parent
698b4049a3
commit
320989d21f
|
@ -45,11 +45,12 @@
|
||||||
- name: Manage labels
|
- name: Manage labels
|
||||||
block:
|
block:
|
||||||
- name: Manage the swarm nodes labels
|
- name: Manage the swarm nodes labels
|
||||||
docker_node:
|
shell: docker node update --label-{{ item.action | default('add') }} {{ item.key }}={{ item.value }} {{ ansible_hostname }}
|
||||||
hostname: '{{ ansible_hostname }}'
|
#docker_node:
|
||||||
labels:
|
# hostname: '{{ ansible_hostname }}'
|
||||||
"{{ item.key }}": '{{ item.value }}'
|
# labels:
|
||||||
labels_state: '{{ docker_label_state_mode }}'
|
# "{{ item.key }}": '{{ item.value }}'
|
||||||
|
# labels_state: '{{ docker_label_state_mode }}'
|
||||||
with_items: '{{ docker_node_labels }}'
|
with_items: '{{ docker_node_labels }}'
|
||||||
|
|
||||||
when: docker_swarm_node | bool
|
when: docker_swarm_node | bool
|
||||||
|
|
Loading…
Reference in New Issue