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 sys | |
import BaseHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
from StringIO import StringIO | |
import random | |
class RandomExitCodes(SimpleHTTPRequestHandler): | |
def list_directory(self, path): | |
f = StringIO() |
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
===================================================================== | |
- name: install formulas | |
action: > | |
homebrew | |
{% if item is mapping %} | |
name={{item.name}} state=present | |
{% if 'options' in item %} | |
install_options={{item.options}} | |
{% endif %} |
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
imgadm import a1d74530-4212-11e3-8a71-a7247697c8f2 | |
vmadm create <<EOF | |
{ | |
"alias": "ansible" | |
,"hostname": "ansible" | |
,"zfs_root_compression": "on" | |
,"autoboot": false | |
,"brand": "joyent" | |
,"dataset_uuid": "a1d74530-4212-11e3-8a71-a7247697c8f2" | |
,"max_physical_memory": 256 |
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
diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py | |
index 8fec285..cda5b77 100644 | |
--- a/lib/ansible/runner/__init__.py | |
+++ b/lib/ansible/runner/__init__.py | |
@@ -188,6 +188,10 @@ class Runner(object): | |
self.callbacks.runner = self | |
self.original_transport = self.transport | |
+ # PATCH | |
+ import uuid |
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
```` | |
diff --git a/lib/ansible/runner/connection_plugins/ssh.py b/lib/ansible/runner/connection_plugins/ssh.py | |
index 68c6f17..8f5c468 100644 | |
--- a/lib/ansible/runner/connection_plugins/ssh.py | |
+++ b/lib/ansible/runner/connection_plugins/ssh.py | |
@@ -251,6 +251,14 @@ class Connection(object): | |
if p.returncode != 0 and controlpersisterror: | |
raise errors.AnsibleError('using -c ssh on certain older ssh versions may not support ControlPersist, s | |
+ |
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
jtanner@u1304:~/ansible$ cat lib/ansible/runner/action_plugins/fakecloud.py | |
# action plugin | |
import re | |
import ansible.constants as C | |
from ansible import utils | |
from ansible import errors | |
from ansible.runner.return_data import ReturnData | |
from ansible.inventory.host import Host | |
from ansible.inventory.group import Group |
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
<Zart> let me explain how it works at el (docs are pretty unclear): first, the file is split into lines. then it searches for regexp= pattern to find a place to insert line into. if it's not found, it looks for insertbefore/insertafter markers. if regexp was found replaces matched line with line= as-is, if not inserts into insertafter marker if provided or insertbefore if provided. in absence of those append to the end of file | |
<Zart> all that logic works with backrefs=no | |
<Zart> with backrefs=yes insertafter/before are irrelevant, and the regexp=/line= becomes like sed -e s/regexp/line/ instead | |
<Zart> with state=absent it looks for either regexp= match or literal line= match and removes the first hit if found | |
<Zart> and by "file is split into lines" I mean that pattern is always matched against single lines, never multiple. so matching 'one line\nsecond line' wont work | |
<Zart> if there are multiple matches state=absent will remove hits one-by-one on each run, so it's not really idempotent in that case. for repl |
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
$ cat ./0000-travis-accelerate-keys/makeinventory.py | |
#!/usr/bin/python | |
import os | |
import sys | |
import string | |
import epdb | |
import json | |
extra_data = " ansible_ssh_user=root ansible_ssh_host=192.168.1.148" |
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
diff --git a/bin/ansible-pull b/bin/ansible-pull | |
index 78f4d21..e8a0023 100755 | |
--- a/bin/ansible-pull | |
+++ b/bin/ansible-pull | |
@@ -45,6 +45,8 @@ import sys | |
import datetime | |
import socket | |
from ansible import utils | |
+import shlex | |
+import select |
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
#!/usr/bin/python | |
#################### | |
# ansiblecaller.py | |
#################### | |
import os | |
import sys | |
import subprocess | |
import shlex |
OlderNewer