Skip to content

Instantly share code, notes, and snippets.

@ashusaini
Created August 23, 2018 04:29
Show Gist options
  • Save ashusaini/93ba2f257d36ccf81f09c75eb5980181 to your computer and use it in GitHub Desktop.
Save ashusaini/93ba2f257d36ccf81f09c75eb5980181 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