I hereby claim:
- I am cchurch on github.
- I am flyingfred0 (https://keybase.io/flyingfred0) on keybase.
- I have a public key ASBNH4qEsFwxMks88hGONV4ujTBGyV2t6vPGRVpY0NHhRgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env python | |
| # (c) 2017, Brian Coca <[email protected]> | |
| # | |
| # 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. | |
| # | |
| # Ansible is distributed in the hope that it will be useful, |
| # Python | |
| import time | |
| __all__ = ['Timeout'] | |
| class Timeout(object): | |
| def __init__(self, duration=None): | |
| # If initializing from another instance, create a new timeout from the |
| import threading | |
| xmlsec_init_lock = threading.Lock() | |
| xmlsec_initialized = False | |
| import dm.xmlsec.binding | |
| original_xmlsec_initialize = dm.xmlsec.binding.initialize | |
| def xmlsec_initialize(*args, **kwargs): | |
| global xmlsec_init_lock, xmlsec_initialized, original_xmlsec_initialize | |
| with xmlsec_init_lock: |
| # Custom Python social auth pipeline functions to fetch a GitHub user's orgs | |
| # and teams. | |
| def fetch_github_user_orgs(backend, details, user=None, *args, **kwargs): | |
| if not user or not hasattr(backend, 'get_json'): | |
| return | |
| response = kwargs.get('response') or {} | |
| if 'organizations_url' not in response or 'access_token' not in response: | |
| return | |
| orgs = backend.get_json(response['organizations_url'], |
| # Python | |
| import time | |
| class CallbackModule(object): | |
| ''' | |
| Delay after Rackspace DNS API requests to avoid rate limit (20/minute). | |
| ''' | |
| def _rate_limit(self): | |
| role_name = getattr(getattr(self, 'task', None), 'role_name', '') |
| --- | |
| - hosts: windows | |
| gather_facts: false | |
| vars: | |
| ansible_python_interpreter: python | |
| tasks: | |
| - win_chocolatey: | |
| name: python2 | |
| state: present |
| { | |
| "log": { | |
| "id": "http://192.168.43.81:8080/api/collections/nodes/node1/log", | |
| "name": "log" | |
| }, | |
| "tags": [], | |
| "facts": { | |
| "hardwareisa": "x86_64", | |
| "macaddress": "08:00:27:e7:06:4d", | |
| "architecture": "x86_64", |
| iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1')) |
| def clixml(a, top=True): | |
| import xml.etree.ElementTree as ET | |
| if top: | |
| objects = ET.Element('Objects') | |
| obj = clixml(a, top=False) | |
| obj.tag = 'Object' | |
| objects.append(obj) | |
| return ET.tostring(objects) | |
| elif a is None: | |
| return ET.Element('Property') |