ansible-nas/tasks/joomla.yml

45 lines
1.2 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:
2019-06-22 13:06:17 +00:00
traefik.backend: "joomla"
2019-06-21 14:53:47 +00:00
traefik.frontend.rule: "Host: joomla.{{ ansible_nas_domain }}"
2019-06-21 10:32:44 +00:00
traefik.enable: "{{ joomla_available_externally }}"
traefik.port: "{{ joomla_port }}"