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 __future__ import (absolute_import, division, print_function) | |
__metaclass__ = type | |
import boto | |
import boto.vpc | |
import boto.ec2 | |
from ansible.plugins.lookup import LookupBase | |
from ansible.errors import AnsibleError | |
from ansible.module_utils.ec2 import * |
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
## Usage: lookup('tier_subnetsV1', 'vpc_id=vpc-2344 tier=dmz1') | |
import boto | |
import boto.vpc | |
import boto.ec2 | |
from ansible import utils | |
class LookupModule(object): | |
def __init__(self, basedir=None, **kwargs): | |
self.basedir = basedir |
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
## Usage "{{ lookup('tier_subnets', 'vpc_id=vpc-7fb0841a tier=dmz1') }}" | |
from __future__ import (absolute_import, division, print_function) | |
__metaclass__ = type | |
import boto | |
import boto.vpc | |
import boto.ec2 | |
from ansible.plugins.lookup import LookupBase | |
from ansible.errors import AnsibleError |
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 __future__ import (absolute_import, division, print_function) | |
__metaclass__ = type | |
import urllib2 | |
import tempfile | |
import os | |
from ansible.errors import AnsibleError | |
from ansible.plugins.lookup import LookupBase | |
from ansible.module_utils.urls import open_url, ConnectionError, SSLValidationError |
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
--- | |
- hosts: all | |
gather_facts: no | |
connection: local | |
vars: | |
varname: "from_vars" | |
rolevar: "from_vars" | |
pre_tasks: |
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/python | |
import os | |
from stat import * | |
def exec_bms_action(module, bms_home, bms_options, overrides, bms_module, command, command_opts): | |
cmd_str = '%s bms' % bms_home | |
cmd = [cmd_str] | |
if bms_options: |
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
{{ lookup_test }} |
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
def get_memory_facts(self): | |
# Here we declare a new list | |
memstats = {} | |
if not os.access("/proc/meminfo", os.R_OK): | |
return | |
for line in open("/proc/meminfo").readlines(): | |
data = line.split(":", 1) | |
key = data[0] |
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
# Copyright (c) 2014, Matt Makai | |
# All rights reserved. | |
# Full License can be read here: http://bit.ly/1qBgqzn | |
from flask.ext.socketio import emit | |
from . import socketio | |
@socketio.on('connect', namespace='/presentation') | |
def test_connect(): |
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
# Copyright (c) 2014, Matt Makai | |
# All rights reserved. | |
# Full License can be read here: http://bit.ly/1qBgqzn | |
import cgi | |
from flask import render_template, abort, request | |
from jinja2 import TemplateNotFound | |
from twilio import twiml | |
from twilio.rest import TwilioRestClient | |