This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Pavan Kumar Sunkara | |
email = [email protected] | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[sendemail] | |
smtpencryption = tls | |
smtpserver = smtp.gmail.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto | |
import datetime | |
cw = boto.connect_cloudwatch() | |
instance_id = boto.utils.get_instance_metadata()['instance-id'] | |
now = datetime.datetime.utcnow() | |
start_time = now - datetime.timedelta(days=1) | |
namespace = "System" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
First generate the hosts.yaml file using the ec2.py inventory script. | |
./inventory/ec2.py --refresh-cache > hosts.yaml | |
""" | |
import os | |
import yaml | |
user = "ec2-user" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Deploys a new version of foo | |
- name: Deploy new version of foo | |
hosts: tag_type_appserver:&tag_stage_prod | |
user: ubuntu | |
sudo: true | |
gather_facts: false | |
serial: 1 | |
vars_prompt: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#============== | |
# Start | |
#============== | |
init() { | |
sudo apt-get update | |
sudo apt-get -y dist-upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run this script with: | |
# bash <(curl -s https://gist.github.com/garlandkr/e80674b49270b0199fa6/raw/ami-clean.sh | |
function print_green { | |
echo -e "\e[32m${1}\e[0m" | |
} | |
print_green 'Clean Yum' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Requeriments: | |
$ sudo pip install boto dnspython | |
Edit ~/.boto to use your AWS credentials | |
""" | |
import time | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible-playbook -i inventory create-ec2-instance.yml --limit dev-web-server-78a -vv | |
Traceback (most recent call last): | |
File "/usr/local/bin/ansible-playbook", line 309, in <module> | |
sys.exit(main(sys.argv[1:])) | |
File "/usr/local/bin/ansible-playbook", line 150, in main | |
inventory = ansible.inventory.Inventory(options.inventory, vault_password=vault_pass) | |
File "/usr/local/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 100, in __init__ | |
self.parser = InventoryDirectory(filename=host_list) | |
File "/usr/local/lib/python2.7/site-packages/ansible/inventory/dir.py", line 58, in __init__ | |
parser = InventoryParser(filename=fullpath) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will cause full debug output to go to the console | |
import boto | |
boto.set_stream_logger('foo') | |
ec2 = boto.connect_ec2(debug=2) |