2023-08-17 19:01:57 +00:00
|
|
|
---
|
|
|
|
- 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 }}"
|
2023-08-17 19:58:57 +00:00
|
|
|
mounts:
|
|
|
|
- target: /var/lib/mysql
|
|
|
|
source: "{{ stack_prefix_name }}ghost_db_data"
|
2023-08-17 19:01:57 +00:00
|
|
|
|
|
|
|
- name: Run Ghost
|
|
|
|
docker_container:
|
|
|
|
name: "{{ stack_prefix_name }}ghost"
|
|
|
|
recreate: true
|
|
|
|
restart_policy: unless-stopped
|
2023-11-01 23:06:40 +00:00
|
|
|
image: docker.io/library/ghost:5.71
|
2023-08-17 19:01:57 +00:00
|
|
|
env:
|
2023-08-21 18:04:03 +00:00
|
|
|
url: https://www.sean.wtf
|
|
|
|
# MySQL DB
|
2023-08-17 19:01:57 +00:00
|
|
|
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
|
2023-08-21 18:04:03 +00:00
|
|
|
# Mail config
|
|
|
|
mail__transport: "{{ secret_ghost_mail_transport }}"
|
|
|
|
mail__options__host: "{{ secret_ghost_mail_host }}"
|
|
|
|
mail__options__port: "{{ secret_ghost_mail_port }}"
|
|
|
|
mail__options__secureConnection: "{{ secret_ghost_mail_secure_connection }}"
|
|
|
|
mail__options__auth__user: "{{ secret_ghost_mail_user }}"
|
|
|
|
mail__options__auth__pass: "{{ secret_ghost_mail_password }}"
|
2023-08-17 19:01:57 +00:00
|
|
|
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 }}"
|