Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker_swarm] enable easy way to add all hosts as workers to existing Docker Swarm #795

Open
bluepuma77 opened this issue Feb 12, 2024 · 0 comments
Labels
docker-swarm Docker Swarm enhancement New feature or request question Further information is requested

Comments

@bluepuma77
Copy link

SUMMARY

Enable easy way to add all hosts as workers to existing Docker Swarm

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

docker_swarm

ADDITIONAL INFORMATION

I can initialise a Docker Swarm with filtering all hosts for tag swarm_manager=true:

# hosts.ini
[all]
srv1 ansible_host=1.2.3.4 ansible_user=root swarm_manager=true
srv2 ansible_host=1.2.3.5 ansible_user=root
srv3 ansible_host=1.2.3.6 ansible_user=root swarm_manager=true
srv4 ansible_host=1.2.3.7 ansible_user=root
srv5 ansible_host=1.2.3.8 ansible_user=root swarm_manager=true
srv6 ansible_host=1.2.3.9 ansible_user=root
- hosts: all
  gather_facts: true

  tasks:
    - name: Init a new Docker Swarm on managers
      community.docker.docker_swarm:
        state: present
      when: hostvars[inventory_hostname]['swarm_manager'] | default(false) == "true"

How can I easily join the other hosts to the existing Docker Swarm as simple workers?

Is this a missing feature or just missing as an example?

state: present means manager and state: join means worker?

How to retrieve the join data from the manager nodes when iterating over worker nodes?

@felixfontein felixfontein added enhancement New feature or request docker-swarm Docker Swarm question Further information is requested labels Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker-swarm Docker Swarm enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants