Skip to content

Instantly share code, notes, and snippets.

@sevkin
Last active December 24, 2019 14:47
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 sevkin/e81117ec3c84a6e06803cec7a352c43b to your computer and use it in GitHub Desktop.
Save sevkin/e81117ec3c84a6e06803cec7a352c43b to your computer and use it in GitHub Desktop.
ansible bootstrap python on deb based distros
- hosts: all
any_errors_fatal: True
gather_facts: no
become: True
tasks:
- name: test python-apt
raw: "which python && python -c \"import apt\""
ignore_errors: True
changed_when: False
failed_when: False
register: bootstrap_python
- name: install python-apt
raw: "apt update && apt install -y python-apt"
when: bootstrap_python.rc != 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment