44 lines
1.4 KiB
YAML
44 lines
1.4 KiB
YAML
---
|
|
- name: Setup Ghost CMS
|
|
|
|
hosts: all
|
|
|
|
vars_files:
|
|
- vault.yaml
|
|
- vars.yaml
|
|
|
|
tasks:
|
|
- name: Run Ghost MySQL DB
|
|
docker_container:
|
|
name: "{{ stack_prefix_name }}ghost-db"
|
|
recreate: true
|
|
restart_policy: unless-stopped
|
|
image: docker.io/library/mysql:8.0
|
|
env:
|
|
MYSQL_ROOT_PASSWORD: "{{ secret_ghost_db_password }}"
|
|
networks:
|
|
- name: "{{ stack_internal_network }}"
|
|
state: "{{ container_state }}"
|
|
|
|
- name: Run Ghost
|
|
docker_container:
|
|
name: "{{ stack_prefix_name }}ghost"
|
|
recreate: true
|
|
restart_policy: unless-stopped
|
|
image: docker.io/library/ghost:5.59-alpine
|
|
env:
|
|
database__client: mysql
|
|
database__connection__host: "{{ stack_prefix_name }}ghost-db"
|
|
database__connection__user: root
|
|
database__connection__password: "{{ secret_ghost_db_password }}"
|
|
database__connection__database: ghost
|
|
url: https://www.sean.wtf
|
|
networks:
|
|
- name: "{{ stack_prefix_name }}{{ docker_internal_network }}"
|
|
# Ghost needs to talk to the outside world to fetch stuff.
|
|
- name: "{{ stack_prefix_name }}{{ docker_external_network }}"
|
|
mounts:
|
|
- target: /var/lib/ghost/content
|
|
source: "{{ stack_prefix_name }}ghost_data"
|
|
state: "{{ container_state }}"
|