test: fix molecule tests

This commit is contained in:
Adrien Waksberg 2024-05-11 09:40:34 +02:00
parent b12b0ba26a
commit 4c73541df7
2 changed files with 24 additions and 12 deletions

View file

@ -8,18 +8,20 @@
swarm_init: true swarm_init: true
swarm_networks: swarm_networks:
proxy: proxy:
driver: overlay
scope: swarm
swarm_services: swarm_services:
traefik: traefik:
image: traefik:1.7 image: traefik:3.0
networks: networks:
- proxy - proxy
args: args:
- '--api' - "--providers.swarm=true"
- '--docker' - "--providers.swarm.network=proxy"
- "--entrypoints.http.address=:80"
publish: publish:
- published_port: 80 - published_port: 80
target_port: 80 target_port: 80
mode: host
mounts: mounts:
- source: /var/run/docker.sock - source: /var/run/docker.sock
target: /var/run/docker.sock target: /var/run/docker.sock
@ -28,10 +30,11 @@
networks: networks:
- proxy - proxy
labels: labels:
traefik.enable: 'true' traefik.enable: "true"
traefik.backend: whoami traefik.http.services.whoami.loadbalancer.server.port: "8000"
traefik.frontend.rule: 'Host:whoami' traefik.http.routers.whoami.rule: "Host(`whoami`)"
traefik.port: '8000' traefik.http.routers.whoami.service: whoami
traefik.http.routers.whoami.entrypoints: http
pre_tasks: pre_tasks:
- name: Update apt cache - name: Update apt cache

View file

@ -11,9 +11,18 @@ platforms:
command: /bin/systemd command: /bin/systemd
capabilities: capabilities:
- SYS_ADMIN - SYS_ADMIN
lint: |
set -e
yamllint .
ansible-lint .
verifier: verifier:
name: testinfra name: testinfra
scenario:
test_sequence:
- dependency
- cleanup
- destroy
- syntax
- create
- prepare
- converge
- side_effect
- verify
- cleanup
- destroy