Skip to content

Instantly share code, notes, and snippets.

@ashusaini
Created August 23, 2018 04:29
Show Gist options
  • Save ashusaini/b2fc42f3c5b99b8e5c0b046d62a6ce5f to your computer and use it in GitHub Desktop.
Save ashusaini/b2fc42f3c5b99b8e5c0b046d62a6ce5f to your computer and use it in GitHub Desktop.
This file is very helpful when you want to connect ansible to your server, i will enable ansible to perform other actions to server
- hosts: all
gather_facts: False
become: true
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
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment