Skip to content

afonsoduarte/ansible-grav

Repository files navigation

ansible-grav

Ansible playbooks for setting up a LE(M)P stack for Grav.

  • Local development environment with Vagrant
  • High-performance production servers
  • One-command deploys

These playbooks were shamelessly ripped off from the excellent Trellis, a collection of ansible playbooks for a WordPress server.

What's included

These playbooks will configure a server with the following and more:

  • Ubuntu 14.04 Trusty LTS
  • Nginx (with optional FastCGI micro-caching)
  • PHP 7.0
  • SSL support (scores an A+ on the Qualys SSL Labs Test)
  • Let's Encrypt integration for free SSL certificates
  • HTTP/2 support (requires SSL)
  • Composer
  • WP-CLI
  • sSMTP (mail delivery)
  • MailHog
  • Memcached
  • Fail2ban
  • ferm

Requirements

Make sure all dependencies have been installed before moving on:

Installation

The recommended directory structure looks like:

example.com/          # → Root folder for the project
├── ansible-grav/     # → Your clone of this repository
└── site/             # → Grav folder
  1. Create a new project directory: $ mkdir example.com && cd example.com
  2. Clone ansible-grav: $ git clone --depth=1 [email protected]:afonsoduarte/ansible-grav.git && rm -rf ansible-grav/.git
  3. Install the Ansible Galaxy roles: $ cd ansible-grav && ansible-galaxy install -r requirements.yml
  4. Download Grav: https://getgrav.org/downloads, unpack, rename folder to site, and put it in your project root folder

Documentation

This project does not have its own documentation. Instead, please check the Trellis documentation on which this project is based.

Local development setup

  1. Configure your Grav sites in group_vars/development/grav_sites.yml and in group_vars/development/vault.yml
  2. Run vagrant up

Read the local development docs for more information.

Remote server setup (staging/production)

A base Ubuntu 14.04 server is required for setting up remote servers.

  1. Configure your Grav sites in group_vars/<environment>/grav_sites.yml and in group_vars/<environment>/vault.yml (see the Vault docs for how to encrypt files containing passwords)
  2. Add your server IP/hostnames to hosts/<environment>
  3. Specify public SSH keys for users in group_vars/all/users.yml (see the SSH Keys docs)
  4. Run ansible-playbook server.yml -e env=<environment> to provision the server

Read the remote server docs for more information.

Deploying to remote servers

  1. Add the repo (Git URL) of your Grav project in the corresponding group_vars/<environment>/grav_sites.yml file
  2. Set the branch you want to deploy
  3. Run ./deploy.sh <environment> <site name>
  4. To rollback a deploy, run ansible-playbook rollback.yml -e "site=<site name> env=<environment>"

Read the deploys docs for more information.

Contributing

Contributions are welcome from everyone. We have contributing guidelines to help you get started.

Community

Keep track of development and community news.

About

A collection of ansible playbooks for a LE(M)P stack for Grav

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors