test: add forgejo workflow
This commit is contained in:
parent
4c73541df7
commit
518919196d
3 changed files with 41 additions and 21 deletions
18
.forgejo/workflows/molecule.yml
Normal file
18
.forgejo/workflows/molecule.yml
Normal 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
|
|
@ -2,11 +2,11 @@
|
||||||
extends: default
|
extends: default
|
||||||
|
|
||||||
ignore: |
|
ignore: |
|
||||||
.kitchen/*
|
.kitchen*
|
||||||
vendor/
|
vendor/
|
||||||
|
.forgejo/
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
line-length:
|
line-length:
|
||||||
max: 120
|
max: 120
|
||||||
level: warning
|
level: warning
|
||||||
truthy: false
|
|
||||||
|
|
40
README.md
40
README.md
|
@ -1,30 +1,32 @@
|
||||||
# Ansible role: Docker Swarm
|
# 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
|
Install and configure docker with swarm
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
* Ansible >= 2.10
|
- Ansible >= 2.10
|
||||||
* Debian Bookworm
|
- Debian Bookworm
|
||||||
|
|
||||||
## Role variables
|
## Role variables
|
||||||
|
|
||||||
* `swarm_init` - init the cluster, run once with the ansible option `-e swarm_init=true` (default: `false`)
|
- `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_manager` - set the cluster role (default: `false`)
|
||||||
* `swarm_advertise_addr` - listen address
|
- `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_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_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_remote_addrs` - manager addresses for slave node
|
||||||
* `swarm_networks` - array with the docker networks
|
- `swarm_networks` - array with the docker networks
|
||||||
|
|
||||||
```
|
```
|
||||||
proxy:
|
proxy:
|
||||||
state: present
|
state: present
|
||||||
```
|
```
|
||||||
|
|
||||||
* `swarm_services` - hash with the service to manage
|
- `swarm_services` - hash with the service to manage
|
||||||
|
|
||||||
```
|
```
|
||||||
wordpress:
|
wordpress:
|
||||||
|
@ -54,7 +56,7 @@ wordpress:
|
||||||
state: present
|
state: present
|
||||||
```
|
```
|
||||||
|
|
||||||
* `swarm_registry_logins` - hash with the registry logins
|
- `swarm_registry_logins` - hash with the registry logins
|
||||||
|
|
||||||
```
|
```
|
||||||
gitlab:
|
gitlab:
|
||||||
|
@ -64,8 +66,8 @@ gitlab:
|
||||||
user: www-data
|
user: www-data
|
||||||
```
|
```
|
||||||
|
|
||||||
* `swarm_proxy_url` - set a proxy url for http and https requests
|
- `swarm_proxy_url` - set a proxy url for http and https requests
|
||||||
* `swarm_proxy_ignore` - array with ignore host or subnet
|
- `swarm_proxy_ignore` - array with ignore host or subnet
|
||||||
|
|
||||||
```
|
```
|
||||||
- localhost
|
- localhost
|
||||||
|
@ -74,7 +76,7 @@ gitlab:
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
* Install:
|
- Install:
|
||||||
|
|
||||||
```
|
```
|
||||||
- hosts: server
|
- hosts: server
|
||||||
|
@ -86,10 +88,10 @@ gitlab:
|
||||||
|
|
||||||
### Test with molecule and docker
|
### Test with molecule and docker
|
||||||
|
|
||||||
* install [docker](https://docs.docker.com/engine/installation/)
|
- install [docker](https://docs.docker.com/engine/installation/)
|
||||||
* install `python3` and `python3-pip`
|
- install `python3` and `python3-pip`
|
||||||
* install molecule and dependencies `pip3 install molecule 'molecule[docker]' docker ansible-lint testinfra yamllint`
|
- install molecule and dependencies `pip3 install molecule 'molecule[docker]' docker ansible-lint testinfra yamllint`
|
||||||
* run `molecule test`
|
- run `molecule test`
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue