test: add forgejo workflow
All checks were successful
/ lint (push) Successful in 10s
/ molecule (push) Successful in 2m30s

This commit is contained in:
Adrien Waksberg 2024-05-11 11:38:48 +02:00
parent 4c73541df7
commit 518919196d
3 changed files with 41 additions and 21 deletions

View file

@ -0,0 +1,18 @@
---
on: [push]
jobs:
lint:
runs-on: docker
container:
image: code.waks.be/nishiki/molecule:docker
steps:
- uses: actions/checkout@v3
- run: ansible-lint .
- run: yamllint .
molecule:
runs-on: docker
container:
image: code.waks.be/nishiki/molecule:docker
steps:
- uses: actions/checkout@v3
- run: molecule test

View file

@ -2,11 +2,11 @@
extends: default
ignore: |
.kitchen/*
.kitchen*
vendor/
.forgejo/
rules:
line-length:
max: 120
level: warning
truthy: false

View file

@ -1,30 +1,32 @@
# Ansible role: Docker Swarm
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://framagit.org/artifaille/ansible-role-docker/blob/master/LICENSE)
[![Version](https://img.shields.io/badge/latest_version-1.1.0-green.svg)](https://code.waks.be/nishiki/ansible-role-swarm/releases)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://code.waks.be/nishiki/ansible-role-swarm/src/branch/main/LICENSE)
[![Build](https://code.waks.be/nishiki/ansible-role-swarm/actions/workflows/molecule.yml/badge.svg?branch=main)](https://code.waks.be/nishiki/ansible-role-swarm/actions?workflow=molecule.yml)
Install and configure docker with swarm
## Requirements
* Ansible >= 2.10
* Debian Bookworm
- Ansible >= 2.10
- Debian Bookworm
## Role variables
* `swarm_init` - init the cluster, run once with the ansible option `-e swarm_init=true` (default: `false`)
* `swarm_manager` - set the cluster role (default: `false`)
* `swarm_advertise_addr` - listen address
* `swarm_join_token_manager` - join token for manager (use `docker swarm join-token manager` after init to set this variable)
* `swarm_join_token_worker` - join token for worker (use `docker swarm join-token worker` after init to set this variable)
* `swarm_remote_addrs` - manager addresses for slave node
* `swarm_networks` - array with the docker networks
- `swarm_init` - init the cluster, run once with the ansible option `-e swarm_init=true` (default: `false`)
- `swarm_manager` - set the cluster role (default: `false`)
- `swarm_advertise_addr` - listen address
- `swarm_join_token_manager` - join token for manager (use `docker swarm join-token manager` after init to set this variable)
- `swarm_join_token_worker` - join token for worker (use `docker swarm join-token worker` after init to set this variable)
- `swarm_remote_addrs` - manager addresses for slave node
- `swarm_networks` - array with the docker networks
```
proxy:
state: present
```
* `swarm_services` - hash with the service to manage
- `swarm_services` - hash with the service to manage
```
wordpress:
@ -54,7 +56,7 @@ wordpress:
state: present
```
* `swarm_registry_logins` - hash with the registry logins
- `swarm_registry_logins` - hash with the registry logins
```
gitlab:
@ -64,8 +66,8 @@ gitlab:
user: www-data
```
* `swarm_proxy_url` - set a proxy url for http and https requests
* `swarm_proxy_ignore` - array with ignore host or subnet
- `swarm_proxy_url` - set a proxy url for http and https requests
- `swarm_proxy_ignore` - array with ignore host or subnet
```
- localhost
@ -74,7 +76,7 @@ gitlab:
## How to use
* Install:
- Install:
```
- hosts: server
@ -86,10 +88,10 @@ gitlab:
### Test with molecule and docker
* install [docker](https://docs.docker.com/engine/installation/)
* install `python3` and `python3-pip`
* install molecule and dependencies `pip3 install molecule 'molecule[docker]' docker ansible-lint testinfra yamllint`
* run `molecule test`
- install [docker](https://docs.docker.com/engine/installation/)
- install `python3` and `python3-pip`
- install molecule and dependencies `pip3 install molecule 'molecule[docker]' docker ansible-lint testinfra yamllint`
- run `molecule test`
## License