barking_iguana-compound 0.1.15 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f689b6fe18b87887bfc6ef69ad669787821e29e5
4
- data.tar.gz: 756619210722e5fc597360df7973d625d4f6477a
3
+ metadata.gz: ec34247ba6a026839c85eee335343d917a137149
4
+ data.tar.gz: 2151a5f16832f015203a8ca0ab5b24a20e961b8d
5
5
  SHA512:
6
- metadata.gz: 46017f1776d37432197e087c7bb513fe466f8176579c3ed9a463c9269b134a8ff9e6c52d8d9c73d8de54a8783e8305ae533448b2f590cf1b5ae2b0f01ec9c82b
7
- data.tar.gz: 275002bed1d9058a3a37df2d013f09222f001cade275a58020429a849ae0c24676ae0c3a1a70de608c5445a0dcd6743edce7873c987e8d5db36ff3dd0254ce51
6
+ metadata.gz: 36bed3d4d6a13f352804fce44e874f1aab2d3024d570931b12a2ba7e33cdc24ba40d35c1a66081461cbf5384f61b49ad879cd48ada8b2043414c8db206ad8683
7
+ data.tar.gz: 36c2c09529a26a5b4531263ccf2eae258856c97328233d26bfc46f8466e9f56d246c446d6e3fa439a9d16455856c279c122190db5cd2547239a5ce7e855844c0
@@ -2,10 +2,20 @@
2
2
 
3
3
  Entries are in reverse chronological order.
4
4
 
5
- ## *0.1.16* (Current Development)
5
+ ## *0.1.18* (Current Development)
6
6
 
7
7
  * ...
8
8
 
9
+ ## *0.1.17* (2017-09-27)
10
+
11
+ * Bug fix: I made a typo
12
+
13
+ ## *0.1.16* (2017-09-27)
14
+
15
+ * Support extra vars files per stage and per suite, in the form on an
16
+ `extra_vars.json` in the stage directory, with a fallback to the suite
17
+ directory.
18
+
9
19
  ## *0.1.15* (2017-09-25)
10
20
 
11
21
  * Performance improvement: don't query Vagrant for each host for status
@@ -205,6 +205,13 @@ You can see a list of all tests by asking Rake to list them:
205
205
 
206
206
  $ bundle exec rake -T
207
207
 
208
+ ### Changing group vars during Ansible runs
209
+
210
+ Somtimes you'll want to experiement with changing `group_vars` values in
211
+ your tests. You can do this by adding a `extra_vars.json` file to either the
212
+ test stage directory or to the test directory. This will tack an
213
+ `--extra-vars=@path/to/the/extra_vars.json` to the `ansible-playbook` run.
214
+
208
215
  ## Development
209
216
 
210
217
  After checking out the repo, run `bin/setup` to install dependencies. Then, run
@@ -218,7 +225,7 @@ git commits and tags, and push the `.gem` file to [rubygems.org][0].
218
225
 
219
226
  ## Contributing
220
227
 
221
- Bug reports and pull requests are welcome on GitHub at https://github.com/barkingiguana/compound.
228
+ Bug reports and pull requests are welcome on GitHub at [barkingiguana/compound][3].
222
229
 
223
230
  If you'd like to contribute features, please do discuss them by opening an issue on GitHub.
224
231
 
@@ -230,3 +237,4 @@ Please keep [docs/CHANGELOG.md][2] updated as you add/remove/change things.
230
237
  [0]: https://rubygems.org
231
238
  [1]: http://barkingiguana.com/compound/TODO
232
239
  [2]: http://barkingiguana.com/compound/CHANGELOG
240
+ [3]: https://github.com/barkingiguana/compound
@@ -2,7 +2,7 @@ module BarkingIguana
2
2
  module Compound
3
3
  module Ansible
4
4
  class Playbook
5
- attr_accessor :file, :inventory_paths, :limit_pattern, :run_from, :user_name, :private_key_file, :io, :output_verbosity, :show_diff
5
+ attr_accessor :file, :inventory_paths, :limit_pattern, :run_from, :user_name, :private_key_file, :io, :output_verbosity, :show_diff, :extra_vars_file
6
6
 
7
7
  def initialize file, run_from: nil
8
8
  self.file = file
@@ -17,6 +17,11 @@ module BarkingIguana
17
17
  self
18
18
  end
19
19
 
20
+ def extra_vars path
21
+ self.extra_vars_file = path
22
+ self
23
+ end
24
+
20
25
  def diff
21
26
  self.show_diff = !self.show_diff
22
27
  self
@@ -103,6 +108,7 @@ module BarkingIguana
103
108
  c << "-#{'v' * output_verbosity}" if output_verbosity > 0
104
109
  c << "--diff" if show_diff
105
110
  c << "--private-key=#{private_key_file}" unless private_key_file.nil?
111
+ c << "--extra-vars=@#{extra_vars_file}" unless extra_vars_file.nil?
106
112
  c.join ' '
107
113
  end
108
114
  end
@@ -56,6 +56,14 @@ module BarkingIguana
56
56
  test_file
57
57
  end
58
58
 
59
+ def extra_vars?
60
+ File.exists? extra_vars_path
61
+ end
62
+
63
+ def extra_vars_path
64
+ @extra_vars_path ||= stage_file_with_fallback('extra_vars.json')
65
+ end
66
+
59
67
  def playbook_path
60
68
  @playbook_path ||= stage_file_with_fallback('playbook.yml')
61
69
  end
@@ -104,7 +112,13 @@ module BarkingIguana
104
112
  end
105
113
 
106
114
  def playbook
107
- Ansible.playbook(playbook_path, run_from: control_directory).inventory(generated_inventory).stream_to(playbook_logger).verbosity(ansible_verbosity).diff
115
+ Ansible.playbook(playbook_path, run_from: control_directory).tap { |p|
116
+ p.inventory(generated_inventory)
117
+ p.stream_to(playbook_logger)
118
+ p.verbosity(ansible_verbosity)
119
+ p.diff
120
+ p.extra_vars extra_vars_path if extra_vars?
121
+ }
108
122
  end
109
123
 
110
124
  def playbook_logger
@@ -1,5 +1,5 @@
1
1
  module BarkingIguana
2
2
  module Compound
3
- VERSION = "0.1.15"
3
+ VERSION = "0.1.17"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barking_iguana-compound
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig R Webster
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-25 00:00:00.000000000 Z
11
+ date: 2017-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler