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

48 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2018-12-22 13:55:51 +00:00
---
2021-11-22 10:27:46 +00:00
- name: Converge
hosts: all
roles:
2022-04-07 07:56:42 +00:00
- ansible-role-swarm
2018-12-22 13:55:51 +00:00
vars:
2021-11-22 10:43:06 +00:00
swarm_manager: true
2021-11-22 13:38:49 +00:00
swarm_init: true
2021-11-22 10:43:06 +00:00
swarm_networks:
proxy:
2024-05-11 07:40:34 +00:00
driver: overlay
scope: swarm
2021-11-22 10:43:06 +00:00
swarm_services:
traefik:
2024-05-11 07:40:34 +00:00
image: traefik:3.0
2019-03-17 21:43:20 +00:00
networks:
2019-08-24 10:55:56 +00:00
- proxy
args:
2024-05-11 07:40:34 +00:00
- "--providers.swarm=true"
- "--providers.swarm.network=proxy"
- "--entrypoints.http.address=:80"
2019-08-24 10:55:56 +00:00
publish:
- published_port: 80
target_port: 80
mounts:
- source: /var/run/docker.sock
target: /var/run/docker.sock
whoami:
2019-08-24 10:55:56 +00:00
image: jwilder/whoami
networks:
- proxy
labels:
2024-05-11 07:40:34 +00:00
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
2019-08-24 10:55:56 +00:00
2021-11-22 10:27:46 +00:00
pre_tasks:
2023-11-23 10:12:18 +00:00
- name: Update apt cache
2021-11-22 10:27:46 +00:00
ansible.builtin.apt:
update_cache: true
2023-11-23 10:12:18 +00:00
- name: Install package for tests
ansible.builtin.package:
name:
- curl