Update node update config to use node id rather than magic name
This commit is contained in:
		@@ -30,6 +30,12 @@
 | 
				
			|||||||
    remote_addrs: "{{ _docker_swarm_manager_addresses }}"
 | 
					    remote_addrs: "{{ _docker_swarm_manager_addresses }}"
 | 
				
			||||||
    join_token: "{{ _docker_swarm_join_token.stdout.strip() }}"
 | 
					    join_token: "{{ _docker_swarm_join_token.stdout.strip() }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Fetch node swarm ID
 | 
				
			||||||
 | 
					  ansible.builtin.command:
 | 
				
			||||||
 | 
					    cmd: !unsafe docker info --format '{{ .Swarm.NodeID}}'
 | 
				
			||||||
 | 
					  changed_when: false
 | 
				
			||||||
 | 
					  register: _docker_node_id_raw
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# For newly added nodes we don't want to have services be automatically scheduled on them
 | 
					# For newly added nodes we don't want to have services be automatically scheduled on them
 | 
				
			||||||
# until the configuration is complete. The node-up playbook will be responsible for updating
 | 
					# until the configuration is complete. The node-up playbook will be responsible for updating
 | 
				
			||||||
# the node to make it available in the cluster again
 | 
					# the node to make it available in the cluster again
 | 
				
			||||||
@@ -38,4 +44,4 @@
 | 
				
			|||||||
    ansible_python_interpreter: "{{ skylab_ansible_venv }}/bin/python"
 | 
					    ansible_python_interpreter: "{{ skylab_ansible_venv }}/bin/python"
 | 
				
			||||||
  community.docker.docker_node:
 | 
					  community.docker.docker_node:
 | 
				
			||||||
    availability: drain
 | 
					    availability: drain
 | 
				
			||||||
    hostname: "{{ skylab_hostname }}"
 | 
					    hostname: "{{ _docker_node_id_raw.stdout.strip() }}"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user