--- - 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 }}" mounts: - target: /var/lib/mysql source: "{{ stack_prefix_name }}ghost_db_data" - name: Run Ghost docker_container: name: "{{ stack_prefix_name }}ghost" recreate: true restart_policy: unless-stopped image: docker.io/library/ghost:5.71 env: url: https://www.sean.wtf # MySQL DB 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 # 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 }}" 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 }}"