Skip to content

Instantly share code, notes, and snippets.

@mikelfo
Created February 20, 2020 16:08
Show Gist options
  • Select an option

  • Save mikelfo/db3bf786bfcb1906dfa546ffc902ff88 to your computer and use it in GitHub Desktop.

Select an option

Save mikelfo/db3bf786bfcb1906dfa546ffc902ff88 to your computer and use it in GitHub Desktop.
Run Ansible on remote machines even when they don't have python installed yet.
# Import this before any roles on your playbooks: `- import_playbook: ansible-set-up-playbook.yml`
---
- name: ansible_set_up
hosts: all
# This Playbook is run as root @see inventory-*.yml files for details about Privilege Escalation for this playbook
become: yes
# @see https://www.linuxschoolonline.com/how-to-use-ansible-even-it-the-target-host-does-not-have-python-installed/
gather_facts: no
# debugger: always
pre_tasks:
- name: Install python3 using 'raw' module
raw: 'apt-get -y install python3 python-minimal'
tasks: []
roles: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment