kitchen-salt 0.0.14 → 0.0.15

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDcwOTFlMGJmYmQyNjEzODU5ODU3ZDZlOGE1ZDhkMmM2NDQyNjk2NQ==
4
+ OWY5MDg5ZjQ0MzIyNzZlZmYxYzgyYWQxZjMxYTAyZmJkZTYzZGEyMw==
5
5
  data.tar.gz: !binary |-
6
- ZjNkYzYzMzhlMTg4Mjc1ZmJkMTk0MTU2ZThhZjNiNjU3ODA3NDNiMA==
6
+ YmM2NzNkNTgwZTM0ODAwYzBkMDYyODg3MTQ3ZDQzMGYyZjVmOGQ4YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDk2ZTQ5ZTUzOWY5NzU2NjBmZDNiYjZjM2NiMzRhODU2Y2M1ZjIzNWNkZGI2
10
- NWYzMGY0Yjk1NTkzMjE0NGRkMmU0MGQ1ZTM5NTQ0OWE1YzBhYjViOTgzYmM3
11
- MzI0NTMzN2EyOGRhYjk4NDJhMzA2ZjM4MmMxYjJmMmRkZDgxNjE=
9
+ MmZmZjFiMTIwZWY1YWFkNzc2ZGFiYWRhMDZhZDhjZmE0MjIyM2VjNDFiMzQx
10
+ YzdmODIwNjc5YWQ5MzY3MzNjMTBiYWZkYWNhNDdjYjJlNzE1MTdiODc0NzM3
11
+ NWY2MDViOGZiMjhlMzJlMTYwYzdmZjNkNjNkZGQ4NjMwNmYzNzg=
12
12
  data.tar.gz: !binary |-
13
- ZWMyOWE1YmMwZTJmM2U4YjU5ZDMyZmFiM2Y1ZWRkOGYxYzg0MTEwZDZiNmE2
14
- ZGY4YWYxYTI3NGU4OTVjZTcyMTI3MWQ5NmIwNDIzYmNiMThlNDI4MzRmMDIy
15
- MGYzODQ4MjMzMTRlNjAzMDE0ZGU3YWY4ODc4MTI1OTM0MDQwYjE=
13
+ NjcwYTA4ZmYzMmUzYTBiZmFhMjk3MDg2MjJkYmE3ZDIwNTllODc5MDllYTll
14
+ MzlmNzVjNGM0MjQ4YTg5Nzg4Y2ZlZTg2YjUxNmQ3NThmODgzMWQ4MmRiODc3
15
+ MDNmYTg3Y2ExYTc4MmYwMzdiNjk5NzU1NWVjODM4YWYyOWY4YWY=
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Salt
3
- VERSION = "0.0.14"
3
+ VERSION = "0.0.15"
4
4
  end
5
5
  end
@@ -48,7 +48,6 @@ module Kitchen
48
48
  default_config :salt_pillar_root, "/srv/pillar"
49
49
  default_config :salt_state_top, "/srv/salt/top.sls"
50
50
  default_config :state_collection, false
51
- default_config :pillars, {}
52
51
  default_config :state_top, {}
53
52
  default_config :salt_run_highstate, true
54
53
 
@@ -145,6 +144,7 @@ module Kitchen
145
144
  prepare_minion
146
145
  prepare_state_top
147
146
  prepare_pillars
147
+ prepare_grains
148
148
  if config[:state_collection]
149
149
  prepare_state_collection
150
150
  else
@@ -301,6 +301,31 @@ module Kitchen
301
301
  end
302
302
  end
303
303
 
304
+ def prepare_grains
305
+ debug("Grains Hash: #{config[:grains]}")
306
+
307
+ return if config[:grains].nil?
308
+
309
+ info("Preparing grains into #{config[:salt_config]}/grains")
310
+ # we get a hash with all the keys converted to symbols, salt doesn't like this
311
+ # to convert all the keys back to strings again we use unsymbolize
312
+ # then we convert the hash to yaml
313
+ grains = unsymbolize(config[:grains]).to_yaml
314
+
315
+ # generate the filename
316
+ sandbox_grains_path = File.join(sandbox_path, config[:salt_config], 'grains')
317
+ debug("sandbox_grains_path: #{sandbox_grains_path}")
318
+
319
+ # create the directory where the pillar file will go
320
+ FileUtils.mkdir_p(File.dirname(sandbox_grains_path))
321
+
322
+ debug("Rendered grains yaml")
323
+ # create the directory & drop the file in
324
+ File.open(sandbox_grains_path, "wb") do |file|
325
+ file.write(grains)
326
+ end
327
+ end
328
+
304
329
  def prepare_formula
305
330
  info("Preparing formula")
306
331
  debug("Using config #{config}")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-salt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon McCartney
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-27 00:00:00.000000000 Z
11
+ date: 2014-05-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: salt provisioner for test-kitchen
14
14
  email: