Add OneLab Helm chart, Argo CD Application, and GitOps values for k3s
Made-with: Cursor
This commit is contained in:
25
app/playbooks/install-swarm.yml
Normal file
25
app/playbooks/install-swarm.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: Generate the command to join a node as swarm worker
|
||||
hosts: localhost
|
||||
gather_facts: yes
|
||||
|
||||
tasks:
|
||||
- name: Determine Docker swarm status
|
||||
shell: >
|
||||
docker info | egrep 'Swarm: '
|
||||
register: swarm_status
|
||||
become: true
|
||||
|
||||
- name: Prepare the command to join a node as worker in this swarm
|
||||
command: docker swarm join-token worker -q
|
||||
become: true
|
||||
when: "' Swarm: active' in swarm_status.stdout_lines"
|
||||
register: worker_join_token
|
||||
|
||||
- set_fact:
|
||||
run_on_worker: "sudo docker swarm join --token {{ worker_join_token.stdout }} {{ ansible_eth0.ipv4.address }}:2377"
|
||||
|
||||
- debug: var=run_on_worker
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user