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

39 lines
877 B
YAML

---
- name: Converge
hosts: all
roles:
- swarm
vars:
docker_swarm_manager: true
docker_advertise_addr: 127.0.0.1
docker_networks:
- name: proxy
docker_services:
- name: traefik
image: traefik:1.7
networks:
- proxy
args:
- '--api'
- '--docker'
publish:
- published_port: 80
target_port: 80
mode: host
mounts:
- source: /var/run/docker.sock
target: /var/run/docker.sock
- name: whoami
image: jwilder/whoami
networks:
- proxy
labels:
traefik.enable: 'true'
traefik.backend: whoami
traefik.frontend.rule: 'Host:whoami'
traefik.port: '8000'
pre_tasks:
- name: update apt cache
ansible.builtin.apt:
update_cache: true