Installing Grav with Ansible

I decided to learn Ansible today and here’s what I came up with after a few short hours of testing. Note it’s only my first day, so I’m sure improvements can be made - I already have several in mind. Comments are definitely welcome. So far I’ve tested and verified with the server scenarios listed in the QA section of the readme.

If you’re unfamiliar, Ansible is used to automate the setup of freshly-provisioned servers. Once you provision a server with your hosting company, this ‘playbook’ will install NGINX, PHP7 and Grav (with a few other things) in just minutes. All you need to do is configure your DNS to point to your server and you’ll (hopefully) be good-to-go!

Note I created this playbook mainly as a learning exercise, though I will improve/maintain it based on my own needs and any feedback received. If it helps someone install Grav on their server that’s a plus :smiley:

update-20170710: did a major overhaul of the playbook for improved efficiency, along with adding support for Amazon Linux and CentOS.

Current compatibility matrix:

AWS DigitalOcean Google Cloud Vultr
Amazon Linux 2017.03.1 :white_check_mark: :black_circle: :black_circle: :black_circle:
CentOS ‘7’ :black_circle: :black_circle: :white_check_mark: :x:
CentOS 7.3.1611 :black_circle: :white_check_mark: :black_circle: :black_circle:
Debian ‘8’ :black_circle: :black_circle: :white_check_mark: :white_check_mark:
Debian 8.8 :black_circle: :white_check_mark: :black_circle: :black_circle:
Debian 9.0 :black_circle: :white_check_mark: :white_check_mark: :white_check_mark:
Fedora 25 :black_circle: :white_check_mark: :black_circle: :x:
Ubuntu 16.04 :white_check_mark: :black_circle: :white_check_mark: :white_check_mark:
Ubuntu 16.04.2 :black_circle: :white_check_mark: :black_circle: :black_circle:
Ubuntu 16.10 :black_circle: :white_check_mark: :white_check_mark: :white_check_mark:
Ubuntu 17.04 :black_circle: :white_check_mark: :white_check_mark: :white_check_mark:

Note I am not affiliated with any entities other than my own github links


Talk about great timing. I was trying to get working, but it seems like its broken in the latest version of Ansible.

Then I tried porting trellis myself…and failed miserably.

So I gave up and googled “ansible grav” again to see what else was out there. This came up. Will definitely give it a try.

Playbook now supports Debian and Fedora. Thx @wfsaxton!

I acquired a Google Cloud free trial and updated the playbook based on my QA. Updated compatibility matrix appears in the ^^first post^^

playbook has been updated to latest grav-admin release 1.3.0 :sunglasses:


Hello again. I don’t intend to ‘bump’ this topic - sorry - I only post meaningful updates.

Anyway, I have updated the playbook to the latest version of Grav 1.3.1

I was also requested to create a playbook which installs the Gantry 5 Helium Skeleton. Well, instead of creating a whole new playbook I just created a ‘gantry’ branch of the repo with the gantry-specific code. Until I learn more Ansible (have been busy lately) this seems like the easiest way to do it, as the source links are hardcoded into the Ansible plays currently.

Eventually I would like to be able to offer all of the skeletons via this playbook but I must find a more elegant solution before proceeding down that road. Cheers!

1 Like

Thanks Andy! I still need to check this out!

1 Like

This looks great. I’m really interested to see if Trellis type Ansible deploys can be made to work with Grav.