atosatto / ansible-dockerswarm

Docker Engine clustering using "Swarm Mode" and Ansible
https://galaxy.ansible.com/atosatto/docker-swarm/
MIT License
264 stars 148 forks source link

ERROR! the role 'ansible-dockerswarm' was not found #44

Closed egubi closed 4 years ago

egubi commented 6 years ago

First off - i'm new to ansible. I've tried running ansible-playbook that set-up K8's and was able to make it work just fine. I wanted to try SWARM and saw this playbook.

When I try to run the playbook: ansible-playbook -i inventory playbook.yml I'm getting the following error:

ERROR! the role 'ansible-dockerswarm' was not found in /home/master/Projects/ansible-dockerswarm/roles:/home/master/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/master/Projects/ansible-dockerswarm

The error appears to have been in '/home/master/Projects/ansible-dockerswarm/playbook.yml': line 6, column 7, but may be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

roles:

  • { role: ansible-dockerswarm } ^ here

Inventory file:

SWARM01 ansible_ssh_host=172.16.0.171 SWARM02 ansible_ssh_host=172.16.0.172 SWARM03 ansible_ssh_host=172.16.0.173

[docker_engine] SWARM01 SWARM02 SWARM03

[docker_swarm_manager] SWARM01 SWARM02 SWARM03

[docker_swarm_worker] SWARM01 SWARM02 SWARM03

Ansible version: 2.6.4

Not sure how to use the roles (?). ive downloaded the role from Ansible galaxy. but still the same.

Maybe a newbie guide on how to use this?

Thank you!

benyanke commented 6 years ago

You need to do two things:

1) Run ansible-galaxy install atosatto.docker-swarm if you haven't. 2) Switch role to: atosatto.docker-swarm instead of docker-swarm.