Switch NextCloud to docker_compose in Ansible + upgrade to v22

This commit is contained in:
Jesper Hess 2021-10-09 14:13:18 +02:00
parent 2af5165349
commit b6c2db6434
Signed by untrusted user: graffen
GPG key ID: 351A89E40D763F0F

View file

@ -1,48 +1,42 @@
--- ---
- name: setup nextcloud containers
- name: nextcloud network docker_compose:
docker_network: project_name: "nextcloud"
name: nextcloud pull: "yes"
definition:
- name: nextcloud database volume services:
docker_volume: postgres:
name: nextcloud_db image: "postgres:10"
restart: "unless-stopped"
- name: nextcloud database container
docker_container:
name: nextcloud_db
image: postgres:10
state: started
restart_policy: always
networks: networks:
- name: nextcloud - "nextcloud"
volumes: volumes:
- nextcloud_db:/var/lib/postgresql/data - "{{ nextcloud.volume_folder }}/postgres:/var/lib/postgresql/data"
env: environment:
POSTGRES_DB: somethingelse POSTGRES_DB: "nextcloud"
POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: "{{ postgres_passwords.nextcloud }}" POSTGRES_PASSWORD: "{{ postgres_passwords.nextcloud }}"
POSTGRES_USER: "nextcloud"
- name: nextcloud app volume app:
docker_volume: image: "nextcloud:22-apache"
name: nextcloud_app restart: "unless-stopped"
- name: nextcloud app container
docker_container:
name: nextcloud_app
image: nextcloud:apache
state: started
restart_policy: always
networks: networks:
- name: nextcloud - "nextcloud"
- name: external_services - "external_services"
volumes: volumes:
- nextcloud_app:/var/www/html - "{{ nextcloud.volume_folder }}/app:/var/www/html"
env: environment:
VIRTUAL_HOST: "{{ nextcloud.domain }}" VIRTUAL_HOST: "{{ nextcloud.domain }}"
LETSENCRYPT_HOST: "{{ nextcloud.domain }}" LETSENCRYPT_HOST: "{{ nextcloud.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}" LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
POSTGRES_HOST: nextcloud_db POSTGRES_HOST: "nextcloud_postgres_1"
POSTGRES_DB: nextcloud POSTGRES_DB: "nextcloud"
POSTGRES_USER: nextcloud POSTGRES_USER: "nextcloud"
POSTGRES_PASSWORD: "{{ postgres_passwords.nextcloud }}" POSTGRES_PASSWORD: "{{ postgres_passwords.nextcloud }}"
networks:
nextcloud:
postfix:
external: true
external_services:
external: true