Skip to content

Instantly share code, notes, and snippets.

@thejhh
Created May 28, 2020 14:51
Show Gist options
  • Select an option

  • Save thejhh/79ac72e172f2331f2b3a1b521b603610 to your computer and use it in GitHub Desktop.

Select an option

Save thejhh/79ac72e172f2331f2b3a1b521b603610 to your computer and use it in GitHub Desktop.
Python bootstrap for ansible
---
- hosts: hosts
remote_user: root
gather_facts: false
tasks:
- name: Check for Python
raw: test -e /usr/bin/python
changed_when: false
failed_when: false
register: check_python
- name: Install Python
raw: apt update && apt install -y python-minimal
when: check_python.rc != 0
---
- import_playbook: install-python.yml
- hosts: hosts
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment