ansible-nas/tasks/joomla.yml

48 lines
1.4 KiB
YAML
Raw Normal View History

2019-06-21 10:32:44 +00:00
---
- name: Create Joomla Directories
file:
path: "{{ item }}"
state: directory
with_items:
2019-10-19 22:49:55 +00:00
- "{{ joomla_data_directory }}"
- "{{ joomla_data_directory }}/db"
2019-06-21 10:32:44 +00:00
- name: MySQL Docker Container for Joomla
docker_container:
2019-10-19 22:49:55 +00:00
name: joomla_mysql
image: mysql:5.7
2019-06-21 10:32:44 +00:00
pull: true
volumes:
2019-10-19 22:49:55 +00:00
- "{{ joomla_data_directory }}/db:/var/lib/mysql"
2019-06-21 10:32:44 +00:00
env:
2019-10-19 22:49:55 +00:00
MYSQL_DATABASE: "joomla"
MYSQL_USER: "joomla"
MYSQL_ROOT_PASSWORD: "{{ joomla_database_password }}"
2019-06-21 10:32:44 +00:00
restart_policy: unless-stopped
memory: 1g
2019-06-21 14:43:04 +00:00
2019-10-19 22:49:55 +00:00
- name: Joomla Docker Container
2019-06-21 10:32:44 +00:00
docker_container:
name: joomla
image: joomla
pull: true
volumes:
2019-10-19 22:49:55 +00:00
- "{{ joomla_data_directory }}:/var/www/html:rw"
2019-06-21 10:32:44 +00:00
ports:
- "{{ joomla_port }}:80"
2019-06-21 10:32:44 +00:00
links:
2019-10-19 22:49:55 +00:00
- "joomla_mysql:mysql"
2019-06-21 10:32:44 +00:00
env:
2019-10-19 22:49:55 +00:00
JOOMLA_DB_HOST: "mysql"
JOOMLA_DB_USER: "root"
JOOMLA_DB_PASSWORD: "{{ joomla_database_password }}"
2019-06-21 10:32:44 +00:00
restart_policy: unless-stopped
memory: 1g
labels:
traefik.enable: "{{ joomla_available_externally }}"
traefik.http.routers.joomla.rule: "Host(`joomla.{{ ansible_nas_domain }}`)"
traefik.http.routers.joomla.tls.certresolver: "letsencrypt"
traefik.http.routers.joomla.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.joomla.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
2021-02-21 19:50:07 +00:00
traefik.http.services.joomla.loadbalancer.server.port: "80"