Trellis/Ubuntu 16.04/DO

Just wondering if there’s a timeframe to update trellis to 16.04 . DO already has the capability to create 16.04 VPS’s.

Would be great just know.



No real timeframe yet. Probably a couple of months off to let it stabilize first.


So I had a go at provisioning a Ubuntu 16.04 server with Trellis today and thought I’d leave some notes in case they’re useful to anyone else…

Disclaimer - I am not a sysadmin.

Ubuntu 16.04 comes with Python 3.5.1 instead of 2.7 and Ansible requires Python 2 to work.

This means that Trellis 0.9.7 gets stuck determining which user to proceed as:

$ ansible-playbook server.yml -e env=production

PLAY [Ensure necessary variables are defined] **********************************

TASK [Ensure environment is defined] *******************************************
skipping: [localhost]

PLAY [Determine Remote User] ***************************************************

TASK [remote-user : Determine whether to connect as root or admin_user] ********
ok: [ -> localhost]

TASK [remote-user : Set remote user for each host] *****************************
ok: []

TASK [remote-user : Announce which user was selected] **************************
Note: Ansible will attempt connections as user = admin
ok: []

PLAY [WordPress Server - Install LEMP Stack with PHP 7.0 and MariaDB MySQL] ****

TASK [setup] *******************************************************************
System info:
  Ansible; Darwin
  Trellis at "Fix #569 - Only skip subdomains for non-www domains"
Failed to connect to the host via ssh.
fatal: []: UNREACHABLE! => {"changed": false, "unreachable": true}
    to retry, use: --limit @server.retry

PLAY RECAP *********************************************************************             : ok=3    changed=0    unreachable=1    failed=0
localhost                  : ok=0    changed=0    unreachable=0    failed=0

as it cannot find a Python interpreter:

$ ansible production -m ping -u root | FAILED! => {
    "changed": false,
    "failed": true,
    "module_stderr": "",
    "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n",
    "msg": "MODULE FAILURE",
    "parsed": false

To fix this, you must first install Python 2.7 onto the server (related SO question)

You can either SSH into the server and install it yourself:

sudo apt-get install -y python

or you could get Ansible to do it for you by adding the following to trellis/server.yml, above the “Determine Remote User” task :

- name: Install Python 2 on the server so Ansible can talk to it
  hosts: web:&{{ env }}
  gather_facts: false
    - ansible_ssh_user: "root"
    - raw: sudo apt-get install -y python

(which is the way I initially did it) however this method means that you can now only connect as root to provision as I couldn’t quite work out how to run the first command as root and then let the remote-user role determine whether to switch to the admin user.

Which means it’s probably best to install Python 2 with an ad-hoc Ansible command before you provision the server:

# from
ansible production -m raw -a 'apt-get install -y python' -u root
# python 2 installs
ansible-playbook server.yml -e env=production
# server is provisioned using whichever admin user you chose to use

There are probably more things that I’ve missed in upgrading as I’ve only done it the once on the one site but this at least gets you a provisioned server you can deploy to.


Hope this comes in useful to someone


You may also want to use for the vagrant box: the official Xenial box has some issues at the moment.