ansible-wrapper 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/README.md +6 -2
- data/lib/{ansible.rb → ansible-wrapper.rb} +0 -0
- data/lib/ansible/ad_hoc.rb +1 -1
- data/lib/ansible/playbook.rb +3 -3
- data/lib/ansible/safe_pty.rb +3 -3
- data/lib/ansible/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5d98c9b1e164d0509c09b64a132bdf51b8a6478
|
4
|
+
data.tar.gz: 4057169e999f9cf5041eaa5bd8d378a8d4187d22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1b58561ab5ca65cefdf80c8f7ba1e131385509db4e58975fa0dc7495af92e56c70b1090e339623c15127e97187648eb81b95280429fdafbb7f493c757a59d33
|
7
|
+
data.tar.gz: bdf1a0f5974b2e1f7ee98dce419cc095a1a4167058931d45e7550f94e5336761c1b5e93dc40b01952f167dfd4a8ee0aa6d6e56a87e88778912b0aac980eded1b
|
data/.travis.yml
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
language: ruby
|
2
2
|
env:
|
3
|
+
- ANSIBLE_VERSION=1.8.4
|
3
4
|
- ANSIBLE_VERSION=1.9.4
|
4
5
|
- ANSIBLE_VERSION=2.0.0.2
|
6
|
+
- ANSIBLE_VERSION=2.1.0.0
|
7
|
+
- ANSIBLE_VERSION=2.2.0.0
|
5
8
|
rvm:
|
9
|
+
- 2.1.8
|
6
10
|
- 2.2.4
|
11
|
+
- 2.3.0
|
7
12
|
cache: bundler
|
8
13
|
before_install:
|
9
14
|
# make sure everything's up to date
|
data/README.md
CHANGED
@@ -3,12 +3,16 @@
|
|
3
3
|
[](http://badge.fury.io/rb/ansible-wrapper)
|
4
4
|
[](https://travis-ci.org/pgeraghty/ansible-wrapper-ruby)
|
5
5
|
[](https://coveralls.io/github/pgeraghty/ansible-wrapper-ruby?branch=master)
|
6
|
+
[](https://codeclimate.com/github/pgeraghty/ansible-wrapper-ruby)
|
6
7
|
|
7
8
|
#### A lightweight Ruby wrapper around Ansible that allows for ad-hoc commands and playbook execution. The primary purpose is to support easy streaming output.
|
8
9
|
|
9
|
-
##
|
10
|
+
## Requirements
|
10
11
|
|
11
12
|
Ensure [Ansible](http://docs.ansible.com/intro_getting_started.html) is installed and available to shell commands i.e. in PATH.
|
13
|
+
[Tested](https://travis-ci.org/pgeraghty/ansible-wrapper-ruby) with Ansible versions 1.9.4 and 2.0.0.2, but please create an issue if you use a version that fails.
|
14
|
+
|
15
|
+
## Installation
|
12
16
|
|
13
17
|
Add this line to your application's Gemfile:
|
14
18
|
|
@@ -80,7 +84,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
80
84
|
|
81
85
|
## Contributing
|
82
86
|
|
83
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
87
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/pgeraghty/ansible-wrapper-ruby.
|
84
88
|
|
85
89
|
|
86
90
|
## License
|
File without changes
|
data/lib/ansible/ad_hoc.rb
CHANGED
data/lib/ansible/playbook.rb
CHANGED
@@ -5,17 +5,17 @@ module Ansible
|
|
5
5
|
BIN = 'ansible-playbook'
|
6
6
|
extend self
|
7
7
|
|
8
|
-
def run(cmd,
|
8
|
+
def run(cmd, _opts={})
|
9
9
|
cmd_line = [Ansible.env_string, 'ANSIBLE_FORCE_COLOR=True', BIN, cmd]*' '
|
10
10
|
|
11
11
|
`#{cmd_line}`
|
12
12
|
end
|
13
13
|
|
14
14
|
# This method uses PTY because otherwise output is buffered
|
15
|
-
def stream(cmd,
|
15
|
+
def stream(cmd, _opts={})
|
16
16
|
cmd_line = [Ansible.env_string, 'ANSIBLE_FORCE_COLOR=True', BIN, cmd]*' '
|
17
17
|
|
18
|
-
SafePty.spawn(cmd_line) do |r,
|
18
|
+
SafePty.spawn(cmd_line) do |r,_w,_p|
|
19
19
|
block_given? ? yield(r.gets) : puts(r.gets) until r.eof?
|
20
20
|
end
|
21
21
|
end
|
data/lib/ansible/safe_pty.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'pty'
|
2
2
|
|
3
3
|
module SafePty
|
4
|
-
def self.spawn
|
4
|
+
def self.spawn(command)
|
5
5
|
|
6
6
|
PTY.spawn(command) do |r,w,p|
|
7
7
|
begin
|
8
|
-
yield r,w,p
|
8
|
+
yield r,w,p if block_given?
|
9
9
|
rescue Errno::EIO
|
10
|
-
# ignore Errno::EIO: Input/output error @ io_fillbuf
|
10
|
+
nil # ignore Errno::EIO: Input/output error @ io_fillbuf
|
11
11
|
ensure
|
12
12
|
Process.wait p
|
13
13
|
end
|
data/lib/ansible/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ansible-wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Geraghty
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,7 +84,7 @@ files:
|
|
84
84
|
- ansible-wrapper.gemspec
|
85
85
|
- bin/console
|
86
86
|
- bin/setup
|
87
|
-
- lib/ansible.rb
|
87
|
+
- lib/ansible-wrapper.rb
|
88
88
|
- lib/ansible/ad_hoc.rb
|
89
89
|
- lib/ansible/playbook.rb
|
90
90
|
- lib/ansible/safe_pty.rb
|