mtpereira.ghost
Ghost 
This tool installs Ghost, a platform for blogging. By default, it installs the latest version of Ghost from Ghost's homepage.
It will also install the latest Node version available from Nodesource's repository using the nodesource.node role.
Additionally, it sets up an Nginx proxy automatically using the jdauphant.nginx role.
This tool addresses Ghost's issue #2639 for hosts using libc 2.13 or older by ensuring that npm's sqlite3 is compiled ahead of time. It has been tested successfully on Debian Wheezy.
Requirements
None.
Role Variables
You need to provide the following variables:
ghost_install_dir
: The directory to install Ghost. This will also be the home of the user running Ghost. Default is/var/www/ghost
.ghost_user_name
: Username for the Ghost user. Default isghost
.ghost_user_group
: Group for the Ghost user. Default isghost
.ghost_config_mail
: Configuration for Ghost's email (must be in YAML format). Default is{}
.ghosts_config_database
: Database configuration for Ghost (must be in YAML format). Default sets up a sqlite3 database.ghosts_config_server
: Server configuration for Ghost (must be in YAML format). Default is localhost on port 2368.ghost_nodejs_enabled
: Choose to install Node.js or not. Default isyes
.ghost_nginx_enabled
: Choose to configure an Nginx proxy or not. Default isyes
.ghost_nginx_port
: The port Nginx will listen on. Default is80
.ghost_nginx_sites
: Configuration for Nginx sites passed to jdauphant.nginx. Defaults set up a reverse proxy listening on port 80 and restrict access to Ghost's admin page to localhost only.
Internal Variables (Do not change)
ghost_fetch_url
: URL for downloading Ghost. Default ishttps://ghost.org/zip/ghost-latest.zip
.ghost_fetch_dir
: Directory where the Ghost zip file will be stored. Default is/tmp
.ghost_nodejs_pin_priority
: Priority forapt-preferences
. Default is500
.ghost_nodejs_path
: Path to the Node.js binary. Default is/usr/bin/node
.
Dependencies
To install these roles, run ansible-galaxy install -r requirements.yml
.
Local Testing
You can run tests on Debian Wheezy and Ubuntu Trusty systems by using "vagrant up". Here are the following ENV variables:
ANSIBLE_TAGS
: A list of tags to run with Ansible, separated by commas. Default isall
.ANSIBLE_VERBOSE
: The verbosity level for Ansible. Default isv
.
Example Playbook
- hosts: servers
roles:
- mtpereira.ghost
For multiple Ghost instances per host:
- hosts: servers
roles:
- role: mtpereira.ghost
ghost_install_dir: /var/www/ghost_two
ghost_config_server:
host: "127.0.0.1"
port: "2369"
ghost_nginx_sites:
ghost_two:
- listen 8080
- server_name {{ ghost_config_server.host }}
- proxy_set_header X-Real-IP $remote_addr
- proxy_set_header Host $http_host
- location / { proxy_pass {{ ghost_internal_url }}; }
- location ~ ^/ghost/setup { allow {{ ghost_nginx_admin_allowed_cidr }}; deny all; }
- role: mtpereira.ghost
ghost_install_dir: /var/www/ghost_two
ghost_config_server:
host: "127.0.0.1"
port: "2368"
ghost_nginx_sites:
ghost_one:
- listen 80
- server_name {{ ghost_config_server.host }}
- proxy_set_header X-Real-IP $remote_addr
- proxy_set_header Host $http_host
- location / { proxy_pass {{ ghost_internal_url }}; }
- location ~ ^/ghost/setup { allow {{ ghost_nginx_admin_allowed_cidr }}; deny all; }
If you have your own web server setup for multiple instances, you can skip the ghost_nginx_sites
definition.
License
BSD
Author Information
Thanks to nodesource for the Node.js packages repository.
Thanks to SimpliField for the Ansible role.
Thanks to jdauphant for the Nginx role.
ansible-galaxy install mtpereira.ghost