2021-08-09 15:36:42 +00:00
|
|
|
---
|
|
|
|
- name: Create Piwigo Directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "{{ piwigo_config_directory }}"
|
2021-08-17 18:49:47 +00:00
|
|
|
- "{{ piwigo_data_directory }}"
|
2021-08-17 23:13:25 +00:00
|
|
|
- "{{ piwigo_photos }}"
|
2021-08-17 18:49:47 +00:00
|
|
|
|
|
|
|
- name: create MySQL container for Piwigo
|
|
|
|
docker_container:
|
|
|
|
name: piwigo-mysql
|
|
|
|
image: mysql:5.7
|
|
|
|
pull: true
|
|
|
|
volumes:
|
|
|
|
- "{{ piwigo_data_directory }}/mysql:/var/lib/mysql:rw"
|
|
|
|
env:
|
|
|
|
MYSQL_DATABASE: "piwigo"
|
2021-08-17 23:13:25 +00:00
|
|
|
MYSQL_USER: "{{ piwigo_mysql_user }}"
|
|
|
|
MYSQL_PASSWORD: "{{ piwigo_mysql_password }}"
|
|
|
|
MYSQL_ROOT_PASSWORD: "{{ piwigo_mysql_root_password }}"
|
2021-08-17 18:49:47 +00:00
|
|
|
restart_policy: unless-stopped
|
|
|
|
memory: "{{ piwigo_mysql_memory }}"
|
2021-08-09 15:36:42 +00:00
|
|
|
|
|
|
|
- name: Piwigo Docker Container
|
|
|
|
docker_container:
|
|
|
|
name: piwigo
|
|
|
|
image: linuxserver/piwigo
|
|
|
|
pull: true
|
|
|
|
volumes:
|
|
|
|
- "{{ piwigo_config_directory }}:/config:rw"
|
|
|
|
- "{{ piwigo_photos }}:/gallery:rw"
|
2021-08-17 18:49:47 +00:00
|
|
|
links:
|
|
|
|
- piwigo-mysql:db
|
2021-08-17 16:57:54 +00:00
|
|
|
ports:
|
|
|
|
- "{{ piwigo_port }}:80"
|
2021-08-09 18:17:40 +00:00
|
|
|
env:
|
|
|
|
TZ: "{{ ansible_nas_timezone }}"
|
|
|
|
PUID: "{{ piwigo_user_id }}"
|
|
|
|
PGID: "{{ piwigo_group_id }}"
|
|
|
|
VERSION: "{{ piwigo_version }}"
|
|
|
|
restart_policy: unless-stopped
|
2021-08-09 15:36:42 +00:00
|
|
|
memory: "{{ piwigo_memory }}"
|
2021-08-09 18:17:40 +00:00
|
|
|
labels:
|
2021-08-09 15:36:42 +00:00
|
|
|
traefik.enable: "{{ piwigo_available_externally }}"
|
|
|
|
traefik.http.routers.piwigo.rule: "Host(`{{ piwigo_hostname }}.{{ ansible_nas_domain }}`)"
|
|
|
|
traefik.http.routers.piwigo.tls.certresolver: "letsencrypt"
|
|
|
|
traefik.http.routers.piwigo.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.routers.piwigo.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
2021-08-17 16:57:54 +00:00
|
|
|
traefik.http.services.piwigo.loadbalancer.server.port: "80"
|