Skip to content

Instantly share code, notes, and snippets.

View chefgs's full-sized avatar
🏠
Working from home

Saravanan G chefgs

🏠
Working from home
View GitHub Profile
@chefgs
chefgs / ansible_var_precedence.md
Last active June 26, 2019 12:57
Ansible variable precedence (order of priority) from least to greatest -

Ansible Var Precedence

Quite often, Ansible playbook developers finding it diffcult on, where to place the 'vars'. Because Ansible supports variable declaration at various levels.

Here is the order of precedence from least to greatest (the last listed variables winning prioritization):

  • command line values (eg “-u user”)
  • role defaults
  • inventory file or script group vars
  • inventory group_vars/all
  • playbook group_vars/all
@chefgs
chefgs / create_es_domain.py
Created February 7, 2019 12:01
Python Boto3 code for creating AWS Elastic Search Domain
# Script creates the 'n' number of ES doamins
# Arg 1: AWS account profile name
# Arg 2: No of es domain to be created
import boto3
import random
import sys
import json
# Fetch the account ID associated with the profile name passed as input arg