ansible-dockerswarm icon indicating copy to clipboard operation
ansible-dockerswarm copied to clipboard

list, add and remove of labels does not work with ec2 instances

Open cgrigor opened this issue 6 years ago • 1 comments

Hi,

When deploying to ec2-instances the {{ ansible_hostname }} that is returned by Ansible is a shortened version, which makes the following tasks fail.

  • name: Get list of labels ...
  • name: Remove labels from swarm node ...
  • name: Asign labels to swarm nodes | if any ...

Example: returned value by ansible in var {{ ansible_hostname }} = ip-10-210-154-89

value required by swarm ip-10-210-154-89.us-west-1.compute.internal

Ansible provides the fqdn in a var called {{ ansible_fqdn }}

I updated the above tasks to use {{ ansible_fqdn }} and this worked. Thanks, Chris

cgrigor avatar Jun 08 '18 08:06 cgrigor

It can't work because the version you get with ansible-galaxy install atosatto.docker-swarm is not the version shown here. The tasks are missing on the galaxy. The owner needs to update it on ansible-galaxy.

Check out your $HOME/.ansible/roles/atosatto.docker-swarm/tasks/swarm_cluster.yml

chris-str-cst avatar Dec 10 '18 13:12 chris-str-cst