Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imartzen/bootstrap-swarm-project
This Ansible playbook initializes a Docker Swarm cluster on a group of Raspberry Pi devices. It includes roles for system updates, Docker installation, Keepalived configuration system configuration, and Swarm cluster initialization.
https://github.com/imartzen/bootstrap-swarm-project
ansible ansible-playbook ansible-role docker raspberry-pi raspbian swarm
Last synced: about 1 month ago
JSON representation
This Ansible playbook initializes a Docker Swarm cluster on a group of Raspberry Pi devices. It includes roles for system updates, Docker installation, Keepalived configuration system configuration, and Swarm cluster initialization.
- Host: GitHub
- URL: https://github.com/imartzen/bootstrap-swarm-project
- Owner: iMartzen
- License: gpl-3.0
- Created: 2024-08-11T12:39:40.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-17T06:58:41.000Z (2 months ago)
- Last Synced: 2024-10-13T22:42:24.068Z (about 1 month ago)
- Topics: ansible, ansible-playbook, ansible-role, docker, raspberry-pi, raspbian, swarm
- Language: Jinja
- Homepage:
- Size: 189 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Bootstrap Swarm Project
=============================# Description
This Ansible playbook initializes a Docker Swarm cluster on a group of Raspberry Pi devices. It includes roles for system updates, Docker installation, Keepalived configuration system configuration, and Swarm cluster initialization.
Please read through the project to get a better understanding of what it does and what you need in order to be successful.
# Requirements
- Ansible 2.9 or higher
- Raspberry Pi with Raspbian
- SSH access to the nodes# Installation
To use this playbook, ensure Ansible is installed on your machine. For macOS, you can install Ansible using Homebrew:
```
brew install ansible
```
Alternatively, for other platforms, install via `pip`:
```
pip install ansible
```Once Ansible is installed, clone this repository and run the playbook with the following command:
```
ansible-playbook -i playbooks/main.yml
```
Replace `` with the path to your Ansible inventory file, which should contain the list of hosts for your Swarm cluster.# Basic Usage
Simply run the playbook using the command above, specifying the hosts you want to include in your Swarm cluster. The playbook will handle updating the system, installing Docker, configuring the system, and initializing the Swarm cluster.
Example:
```
ansible-playbook -i inventory playbooks/main.yml
```
This will execute the playbook on all hosts listed in the `inventory` file.## Advanced Usage
### Customizing Message Of The Day (MOTD)
You can create a custom message of the day (MOTD), which appears when logging into your system. Update the this [MOTD](playbooks/roles/ansible-role-system-configuration/files/motd) role's variables to define your MOTD message.
### Using Docker Visualizer
The `swarm-initialization` role includes a step to create a Docker service running Docker Visualizer, which is published on port 8081.
# Ansible roles
## [ansible-role-python-raspbian-bootstrap](playbooks/roles/ansible-role-python-raspbian-bootstrap/)
Bootstraps a Raspbian system with Python and essential packages.
Features:
- Updates the package list.
- Installs Python and pip.
- Installs essential Python packages.## [ansible-role-system-upgrade](playbooks/roles/ansible-role-system-upgrade/)
Upgrades system packages to their latest versions.
Features:
Features:
- Updates the package list.
- Upgrades all installed packages.
- Optionally reboots the system if required.## [ansible-role-install-docker](playbooks/roles/ansible-role-install-docker/)
Installs and configures Docker on a target system.
Features:
- Downloads and runs the Docker installation script.
- Adds the current user to the Docker group.
- Configures Docker to start with systemd.
- Sets up Docker daemon configuration.## [ansible-role-system-configuration](playbooks/roles/ansible-role-system-configuration/)
Configures various system settings on a target host.
Features:
- Configures system timezone.
- Sets up hostname and hosts file.
- Manages user accounts and groups.
- Configures SSH settings.## [ansible-role-swarm-initialization](playbooks/roles/ansible-role-swarm-initialization/)
Initializes a Docker Swarm on a target host.
Features:
- Initializes a Docker Swarm on the nodes.
- Manages invitations for managers and workers to join the Swarm.
- Configures Docker Swarm settings.
- Creates a Docker Visualizer service.## [ansible-role-install-keepalived](playbooks/roles/ansible-role-install-keepalived/)
Installs and configures Keepalived for high availability using VRRP on target nodes.
Features:
- Installs Keepalived via the apt package manager.
- Configures VRRP to ensure high availability of network services.
- Dynamically assigns priorities to nodes to define the master and backup roles.
- Manages Keepalived services, ensuring they are properly restarted and running.
- Automatically handles failover between nodes in case of failure.# License
GPLv3