Add swarm config

This commit is contained in:
lif
2025-10-10 19:36:51 +01:00
parent 520fef57a1
commit 069ac709e1
9 changed files with 594 additions and 285 deletions

View File

@@ -1,9 +1,9 @@
---
# Setup Playbook for Debian Linux
# This playbook installs essential dependencies including Python and creates swap
# Setup Playbook for Docker Swarm Cluster
# This playbook installs essential dependencies including Python, Docker, and creates swap
- name: Setup Debian Linux hosts
hosts: alpine
- name: Setup Docker Swarm nodes
hosts: swarm_nodes
become: yes
gather_facts: no
@@ -28,15 +28,15 @@
name:
- python3
- python3-pip
- vim
- ansible
- curl
- wget
- htop
- tree
- git
- openssh-client
- sudo
- util-linux
- apt-transport-https
- ca-certificates
- gnupg
- lsb-release
state: present
- name: Create sudoers entry for vagrant user
@@ -46,12 +46,38 @@
create: yes
mode: '0440'
- name: Install Python packages
pip:
name:
- ansible
- name: Add Docker GPG key
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
become_user: vagrant
- name: Add Docker repository
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/debian bookworm stable"
state: present
update_cache: yes
- name: Install Docker CE
apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose-plugin
state: present
- name: Add vagrant user to docker group
user:
name: vagrant
groups: docker
append: yes
- name: Start and enable Docker service
systemd:
name: docker
state: started
enabled: yes
- name: Verify Python installation
command: python3 --version