I came across the Ansible page explaining how to install their latest version using PIP but I ran in a few dependencies which I’ll share here.
Basically I came across the following dependencies not mentioned on the Ansible page.
So the commands I used to install the devel version of Ansible (the version I was after was 2.2 because of LXD support) were:
apt install -y python python-pip libssl-dev build-essential libffi-dev pip install --upgrade pip pip install git+git://github.com/ansible/ansible.git@devel
Appearantly the libffi-dev package was very important for pycparser.
Also libssl-dev was needed or else compilation was terminated.