blog.lazkani.io/ansible/roles/blog/tasks/main.yml
Elia el Lazkani 226479495e
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
fix(): Adds failsafe to the check mode
This fixes the first deployment problem.
2023-07-01 19:08:30 +02:00

35 lines
1.1 KiB
YAML

---
- name: Deploy Blog Stack
community.docker.docker_compose:
project_name: Blog
state: present
definition:
version: '3'
services:
blog:
container_name: blog
image: "scm.project42.io/elia/blog:{{ blog_container_tag }}"
restart: unless-stopped
networks:
- traefik-ingress
environment:
- "NGINX_PORT={{ blog_http_port }}"
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik-ingress"
- "traefik.http.routers.blog.rule=Host(`blog.lazkani.io`)"
- "traefik.http.routers.blog.service=blog"
- "traefik.http.services.blog.loadbalancer.server.port={{ blog_http_port }}"
- "traefik.http.middlewares.weechat-main.chain.middlewares=frame-deny,browser-xss-filter,ssl-redirect"
- "traefik.http.routers.blog.tls.certresolver=cloudflareresolver"
networks:
traefik-ingress:
external: true
register: output_blog
- assert:
that:
- output_blog.services.blog.blog.state.running
when: not check_mode