mirror of
https://github.com/davestephens/ansible-nas
synced 2024-12-26 19:43:11 +00:00
7002b4378a
Now I need to add all the administrative bits for ansible-nas. I would also like to set it up to pre-populate the configuration information for the database like gitea does. I'll have to read a few more docs for that. But the important part is this is up now.
50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
---
|
|
- name: Create Piwigo Directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
with_items:
|
|
- "{{ piwigo_config_directory }}"
|
|
- "{{ piwigo_data_directory }}"
|
|
|
|
- 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"
|
|
MYSQL_USER: "piwigo"
|
|
MYSQL_PASSWORD: "piwigo"
|
|
MYSQL_ROOT_PASSWORD: "piwigo"
|
|
restart_policy: unless-stopped
|
|
memory: "{{ piwigo_mysql_memory }}"
|
|
|
|
- name: Piwigo Docker Container
|
|
docker_container:
|
|
name: piwigo
|
|
image: linuxserver/piwigo
|
|
pull: true
|
|
volumes:
|
|
- "{{ piwigo_config_directory }}:/config:rw"
|
|
- "{{ piwigo_photos }}:/gallery:rw"
|
|
links:
|
|
- piwigo-mysql:db
|
|
ports:
|
|
- "{{ piwigo_port }}:80"
|
|
env:
|
|
TZ: "{{ ansible_nas_timezone }}"
|
|
PUID: "{{ piwigo_user_id }}"
|
|
PGID: "{{ piwigo_group_id }}"
|
|
VERSION: "{{ piwigo_version }}"
|
|
restart_policy: unless-stopped
|
|
memory: "{{ piwigo_memory }}"
|
|
labels:
|
|
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 }}"
|
|
traefik.http.services.piwigo.loadbalancer.server.port: "80"
|