Skip to content

Instantly share code, notes, and snippets.

@code-later
Created March 19, 2018 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code-later/15e668bf8e74ac653243b0a3c8e7f852 to your computer and use it in GitHub Desktop.
Save code-later/15e668bf8e74ac653243b0a3c8e7f852 to your computer and use it in GitHub Desktop.
Install Python 2.7 with Ansible in pre_tasks
---
- hosts: all
become: True
gather_facts: False
pre_tasks:
- name: Install python for Ansible
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
changed_when: False
- setup: # aka gather_facts
vars:
roles:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment