Ubuntu 16.04 doesn't have python 2.x installed, which is needed by Ansible. For those situations, use the following playbook. Few important parts in it:
gather_facts
: Must be turned off initially. Later on, we enable it via thesetup
task inpre_tasks
.pre_tasks
: Before other tasks/roles kick in, we install python 2.x and aptitude (for some reason, Ubuntu 16.04 LTS asks for it). Optionally, you can usesetup
task to gain back whatever you lost by not runninggather_facts
before.
Start of playbook
- hosts: all
remote_user: root
gather_facts: no