This file contains 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
#!/usr/bin/env python | |
import pyrax | |
pyrax.set_setting('identity_type', 'rackspace') | |
pyrax.set_credentials('myusername', 'myapikey', region='DFW') | |
def server_list_generator(detailed=True, search_opts=None, limit=None): | |
servers = pyrax.cloudservers.servers.list(detailed=detailed, | |
search_opts=search_opts, | |
limit=limit) |
This file contains 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
certs: | |
www_example_com: | |
key: | | |
-----BEGIN RSA PRIVATE KEY----- | |
MIIEowIBAAKCAQEA0cfBegr0ahA1PXrF3fBJURcBxoP8PZow1a6tRGe3ruJZBMSH | |
vx2+dm2Sq3bCPHH2hUkC0Oj2U+54WMzn22ZwVsgOPG7ks1EqKy48K5VPrWDMJqjn | |
MhxLpTaf6xaGUlkVA6xcO5+SNFqzkq8fFWSHmY+E3n03ym0zH/Loy1KYRI0xVPRq | |
ITp7AoPbJ58Lz1X9CgBd7siaVjPvaS6WfosLwlI8gr1h6vqeO7nPrF8B9HnV7867 | |
bSZlkbb6vqgtLg73B4diRGvNn5X9Kpsi1jbp7DAXHj2pGA8kr8TjV6MG28Di/iWL | |
oyiBDziIHe7iV0my+wl12x6o5JTuVVMkbD57AQIDAQABAoIBAB3ysoBFyBbMMY2R |
This file contains 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
sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
sudo yum install -y golang git mercurial make bzr | |
export GOPATH=~/Go | |
export PATH=$PATH:$GOPATH/bin | |
mkdir $GOPATH | |
go get github.com/drone/drone | |
cd $GOPATH/src/github.com/drone/drone | |
make deps | |
make vendor | |
make clean |
This file contains 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 os | |
import sys | |
import smtplib | |
def mail(subject='Ansible Command', sender='<root>', to='root', cc=None, | |
bcc=None, body=None): | |
if not body: | |
body = subject |
This file contains 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
pip install git+https://github.com/ansible/ansible.git@devel#egg=ansible | |
pip install git+https://github.com/sivel/ansible-testing.git#egg=ansible_testing | |
git clone https://github.com/ansible/ansible-modules-core.git | |
ansible-validate-modules ansible-modules-core |
This file contains 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 paramiko | |
# provide host and port variables | |
t = paramiko.transport.Transport('%s:%s' % (host, port)) | |
t.start_client() | |
key = t.get_remote_server_key() | |
if int(port) != 22: | |
host = '[%s]:%s' % (host, port) |
This file contains 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
from openstack.auth.identity.v2 import Password | |
class ApiKey(Password): | |
valid_options = { | |
'access_info', | |
'auth_url', | |
'username', | |
'user_id', | |
'password', |
This file contains 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
#!/usr/bin/env python | |
# (c) 2015, Matt Martz <matt@sivel.net> | |
# | |
# This file is part of Ansible. | |
# | |
# Ansible is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
This file contains 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
go build helloworld.go | |
GOOS=windows GOARCH=amd64 go build helloworld.go |
This file contains 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
diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py | |
index 1804a03..3703062 100644 | |
--- a/lib/ansible/playbook/play_context.py | |
+++ b/lib/ansible/playbook/play_context.py | |
@@ -80,6 +80,13 @@ MAGIC_VARIABLE_MAPPING = dict( | |
su_flags = ('ansible_su_flags',), | |
) | |
+MAGIC_VARIABLE_UNDEFINED = [ | |
+ 'remote_addr', |