#Ansible - Quick overview
using ubuntu :
sudo apt-get install ansible
Using pip(for mac users ) :
pip install ansible
#!/usr/bin/env python3 | |
""" This script is used to ssh parallel on multiple machines and get the output | |
Sample run is - python pssh.py ubuntu@31.215.xx.xx ubuntu@xx.xx.xx.xx:port | |
""" | |
import sys | |
from fabric import ThreadingGroup as Group | |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "AWS cloudformation template to create single VPC, multiple subnets(public and private) with NAT,route tables,network acl's , elasticip for nat , internet gateway for vpc and configure rules for the subnets to talk to internet and talk via NAT(in case of private subnet) in multiple Avalibility zones, An EC2 instance with Elastic ip and install jenkins/nginx/ansible on it.", | |
"Parameters": { | |
"VpcCIDR": { | |
"Description": "Gives the vpc CIDR", | |
"Type": "String", | |
"Default": "10.11.0.0/16" | |
}, | |
"AvailabilityZone1": { |
server { | |
listen 80; | |
server_name InstancePublicIp; | |
location / { | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; |
#!/bin/bash | |
# REF: Sean Kane https://groups.google.com/d/msg/coreos-dev/JAeABXnQzuE/8v_SIPsnCAAJ | |
# create a directory | |
sudo mkdir -p /opt/bin | |
sudo chown -R $(whoami):$(whoami) /opt | |
sudo sh -c 'echo "export PATH=$PATH:/opt/bin" >> /etc/environment' | |
cd /opt/bin | |
wget http://s.minos.io/s -O static-get | |
chmod a+rx ./static-get | |
cd /opt |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "AWS cloudformation template to create single VPC,subnet,route tables", | |
"Parameters": { | |
"VpcCIDR": { | |
"Description": "Gives the vpc CIDR", | |
"Type": "String", | |
"Default": "10.3.0.0/16" | |
}, | |
"AvailabilityZone1": { |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "AWS cloudformation template to create EC2 instancewith custom root volume size", | |
"Parameters": { | |
"InstanceType": { | |
"Description": "WebServer EC2 instance type", | |
"Type": "String", | |
"Default": "t2.small", | |
"AllowedValues": [ | |
"t1.micro", |
#!/usr/bin/env python | |
# run using below command | |
# >> python mandril-sendmail.py "Subject" "Recipent" "Body" | |
import sys | |
import mandrill | |
import logging | |
# calling this would be python SCRIPT_NAME.py "Subject" "Recipent" "body" |
#!/bin/env python | |
# Code to list the particular file types from any weblink | |
# importing libraries | |
import urllib as ul | |
import lxml.html , urlparse | |
import urllib2 | |
# defined base url |