ansible-role-swarm/molecule/default/converge.yml

47 lines
1.2 KiB
YAML

---
- name: Converge
hosts: all
roles:
- ansible-role-swarm
vars:
swarm_manager: true
swarm_init: true
swarm_networks:
proxy:
driver: overlay
scope: swarm
swarm_services:
traefik:
image: traefik:3.0
networks:
- proxy
args:
- "--providers.swarm=true"
- "--providers.swarm.network=proxy"
- "--entrypoints.http.address=:80"
publish:
- published_port: 80
target_port: 80
mounts:
- source: /var/run/docker.sock
target: /var/run/docker.sock
whoami:
image: jwilder/whoami
networks:
- proxy
labels:
traefik.enable: "true"
traefik.http.services.whoami.loadbalancer.server.port: "8000"
traefik.http.routers.whoami.rule: "Host(`whoami`)"
traefik.http.routers.whoami.service: whoami
traefik.http.routers.whoami.entrypoints: http
pre_tasks:
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
- name: Install package for tests
ansible.builtin.package:
name:
- curl