From aebf4d44b52ece2d210dba50a60b156fbfcc00c1 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 6 Nov 2020 15:59:57 +0100 Subject: [PATCH] Add the variable docker_swarm_worker_hostname. --- defaults/main.yml | 1 + tasks/swarm_node.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 217ccd8..608328f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,6 +6,7 @@ docker_swarm_manager: False docker_swarm_manager_availability: 'drain' docker_swarm_node: False docker_swarm_node_availability: 'active' +docker_swarm_worker_hostname: '{{ ansible_fqdn }}' docker_swarm_allowed_hosts: - '0.0.0.0/0' diff --git a/tasks/swarm_node.yml b/tasks/swarm_node.yml index 9aea787..838baa9 100644 --- a/tasks/swarm_node.yml +++ b/tasks/swarm_node.yml @@ -35,7 +35,7 @@ - block: - name: Set the swarm nodes availability. Default 'active' docker_node: - hostname: '{{ ansible_hostname }}' + hostname: '{{ docker_swarm_worker_hostname }}' availability: '{{ docker_swarm_node_availability }}' when: docker_swarm_node | bool