salessandri.ghost

Ghost

This role sets up a Ghost blog using the community's Ghost Docker image.

Requirements

This role needs docker to be installed on the host machine, as well as the docker_container Ansible module in Ansible.

To install Docker, you can use the geerlingguy.docker role.

For the docker_container module, use the geerlingguy.pip role to install Python's docker package.

Role Variables

  • ghost__host (required, default: localhost): This variable defines two things: the URL for the blog and the name of the container. The URL will be https://{{ ghost__host }} and the container name will replace dots with underscores and start with ghost_.
  • ghost__version (optional, default: 5.85.1): The version of the Ghost Docker image to use. Check Ghost image tags on Docker Hub.
  • ghost__base_dir (optional, default: /var/ghost-blog): The folder to store the blog's persistent files.
  • ghost__blog_name (optional, default: Ghost Blog): Name for this role instance in Ansible. It doesn't affect the service itself.
  • ghost__listen_host (optional, default: 127.0.0.1): The address where the container will publish the blog's socket.
  • ghost__listen_port (optional, default: 2368): The port where the container will publish the blog's traffic.
  • ghost__configs (optional, default: {}): A dictionary of configurations to send to the container as environment variables. See Ghost's Configuration Docs for all possible values and here for instructions on converting keys to environment variables.

Suggestions

It's recommended not to expose Ghost's port directly to the internet. Instead, use a reverse proxy like Nginx to handle the traffic. This makes setting up TLS easier and allows multiple applications to share the HTTPS port.

Example Playbook

Here's a typical example of using this role:

- host: my-blog.my-domain.com
  roles:
    - role: salessandri.ghost
      vars:
        ghost__host: my-blog.my-domain.com
        ghost__base_dir: /var/my-blog
        ghost__blog_name: Personal Blog
        ghost__configs:
          mail__from: '"My Blog Email" <[email protected]>'
          mail__transport: 'SMTP'
          mail__options__host: smtp.my-domain.com
          mail__options__port: 465
          mail__options__secureConnection: true
          mail__options__auth__user: blog_mail_user
          mail__options__auth__pass: '{{ blog_mail_password_vault }}'

License

MIT

Author Information

This role was created in 2020 by Santiago Alessandri.

Informazioni sul progetto

Setup a ghost blog using docker container

Installa
ansible-galaxy install salessandri.ghost
Licenza
mit
Download
148
Proprietario