skylab
/
skylab-ansible
Archived
2
0
Fork 0

Update node update config to use node id rather than magic name

This commit is contained in:
Ethan Paul 2021-11-11 00:07:58 -05:00
parent 4275a0bc23
commit 776e35f1a3
No known key found for this signature in database
GPG Key ID: 6A337337DF6B5B1A
1 changed files with 7 additions and 1 deletions

View File

@ -30,6 +30,12 @@
remote_addrs: "{{ _docker_swarm_manager_addresses }}"
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
# until the configuration is complete. The node-up playbook will be responsible for updating
# the node to make it available in the cluster again
@ -38,4 +44,4 @@
ansible_python_interpreter: "{{ skylab_ansible_venv }}/bin/python"
community.docker.docker_node:
availability: drain
hostname: "{{ skylab_hostname }}"
hostname: "{{ _docker_node_id_raw.stdout.strip() }}"