Skip to content

Instantly share code, notes, and snippets.

View omgjlk's full-sized avatar
🤷‍♂️
Inserting sleeps until it works

Jesse Keating omgjlk

🤷‍♂️
Inserting sleeps until it works
View GitHub Profile
@omgjlk
omgjlk / gist:5110097
Created March 7, 2013 17:48
A diff of Puppetfile
commit 475f4dc5b5e50c1e4fdce44bf5ca032f73e6fdce
Author: Jesse Keating <jesse.keating@rackspace.com>
Date: Tue Feb 26 22:34:36 2013 -0800
Add dropbox
diff --git a/Puppetfile b/Puppetfile
index dc90106..0de2c22 100644
--- a/Puppetfile
+++ b/Puppetfile
@omgjlk
omgjlk / gist:5181985
Created March 17, 2013 15:19
Ansible playbook help
---
- name: launch instances
local_action: inova env=$supernova_endpoint
name=${hostname}${item}.${cell_domain} image=$image_id
flavor=$flavor wait=$wait
with_sequence: ${count}:%02d
register: inova
Another file:
@omgjlk
omgjlk / keekz1-rax.yaml
Created July 22, 2013 03:54
example playbook using rax
---
- name: Create a server
hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Make me that server
rax: creds_file=~/.raxpub service=cloudservers name=keekz1 flavor=2
image=<hash> state=present
diff --git a/lib/ansible/runner/connection_plugins/ssh.py b/lib/ansible/runner/connection_plugins/ssh.py
index 68c6f17..74f5eef 100644
--- a/lib/ansible/runner/connection_plugins/ssh.py
+++ b/lib/ansible/runner/connection_plugins/ssh.py
@@ -228,15 +228,19 @@ class Connection(object):
raise errors.AnsibleError('Incorrect sudo password')
if p.stdout in rfd:
- dat = os.read(p.stdout.fileno(), 9000)
- stdout += dat
diff --git a/lib/ansible/runner/connection_plugins/ssh.py b/lib/ansible/runner/con
index 68c6f17..3007304 100644
--- a/lib/ansible/runner/connection_plugins/ssh.py
+++ b/lib/ansible/runner/connection_plugins/ssh.py
@@ -228,18 +228,20 @@ class Connection(object):
raise errors.AnsibleError('Incorrect sudo password')
if p.stdout in rfd:
- dat = os.read(p.stdout.fileno(), 9000)
+ dat = p.stdout.read(9000)
diff --git a/lib/ansible/runner/connection_plugins/ssh.py b/lib/ansible/runner/con
index 68c6f17..e19193f 100644
--- a/lib/ansible/runner/connection_plugins/ssh.py
+++ b/lib/ansible/runner/connection_plugins/ssh.py
@@ -237,9 +237,10 @@ class Connection(object):
stderr += dat
if dat == '':
rpipes.remove(p.stderr)
- if not rpipes or p.poll() is not None:
- p.wait()
#!/usr/bin/python -tt
# 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.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
- name: assessment
hosts: host1:host2:host3:host4
gather_facts: false
tasks:
- name: hostname
command: hostname
delegate_to: host5
@omgjlk
omgjlk / play.yaml
Created July 29, 2014 23:25
play.yaml
---
tasks:
- name: task name here
shell: executable --option=foo --other_option=bar
--third-option=baz chdir=/opt/foobar
- name: derp
gather_facts: false
hosts: all
vars:
foo: bar
missing: derp
tasks:
- command: echo yes
when: foo.startswith('nope') or (missing is defined and missing.starts_with('derp'))