homelab/roles/upgrade/tasks/main.yml

39 lines
995 B
YAML
Raw Normal View History

- name: Download new Traefik container
docker_image:
name: "traefik:{{ traefik_version }}"
source: pull
register: new_traefik
- name: Download new WordPress container
docker_image:
name: "wordpress:{{ wordpress_version }}"
source: pull
register: new_wordpress
- name: Download new MariaDB container
docker_image:
name: "mariadb:{{ mariadb_version }}"
source: pull
register: new_mariadb
- name: Stop and remove old Traefik container
docker_container:
name: "{{ traefik_name }}"
image: "traefik:{{ traefik_version }}"
state: absent
when: new_traefik.changed
- name: Stop and remove old WordPress container
docker_container:
name: "{{ wordpress_name }}"
image: "wordpress:{{ wordpress_version }}"
state: absent
when: new_wordpress.changed
- name: Stop and remove old MariaDB container
docker_container:
name: "{{ mariadb_name }}"
image: "mariadb:{{ mariadb_version }}"
state: absent
when: new_mariadb.changed