batali-wedge 0.0.4 → 0.1.0

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: fe25ce84ec427ce5890f795a124c82641ff81dd8
4
- data.tar.gz: 675f2514c87139dfe9ec33fc8d925bf2b4c0ab76
3
+ metadata.gz: e6f124231d53d1814403f5400386e24a8545241d
4
+ data.tar.gz: 62d952e59accd7f3f5e1612a599f1a68ed11ddc2
5
5
  SHA512:
6
- metadata.gz: 458287805264a5d83887e0240b2a14c821bb85638178730fcfda82a95c0859539d444ae0acd4440804b45e76ea4efec185163394c513c08a085d4d159e85ef9a
7
- data.tar.gz: f8ea5fb97d6d05fddf685d41efaff62b9c8f1038639cc3f56fd7522c77bc35e95216a89a1c6207e5e04303cf6004193297daa2a563d4fb0da6ce08503f76fdfc
6
+ metadata.gz: 9d29e1eb3dfd9b83bdb99c2c20dd577ae15602c9fad0bec2451e9d2ce54157b049cb871de5a155ea5ee553bf4c6ed6bb67b5ce5575ee44d187096f655e517512
7
+ data.tar.gz: b136b66efd8da4256ed80410cad2c7f1d76ba97cb99db12481b8c86345098d1e4fe00e4745f9182d23ca882c7c31a22c0f66cee0621d386454c7910e7e2547e9
data/CHANGELOG.md CHANGED
@@ -0,0 +1,2 @@
1
+ # v0.1.0
2
+ * Initial release
data/README.md CHANGED
@@ -0,0 +1,50 @@
1
+ # Batali Wedge
2
+
3
+ Lets have some fun with `chef-client`!
4
+
5
+ ## Wedge Batali
6
+
7
+ This gem wedges Batali into `chef-client` to perform cookbook
8
+ resolution locally on the node, and request the solution set
9
+ from the Chef Server.
10
+
11
+ ## OMG WHY!?
12
+
13
+ There were old complaints about local solvers not generating
14
+ the same results as the solver on the server. So, what if we
15
+ just used the same solver, then you'd know you had the same
16
+ resolution. This lead to:
17
+
18
+ > I wonder if Batali could be wedged into the client
19
+
20
+ As it turns out, it can.
21
+
22
+ ## Usage
23
+
24
+ This only support 12.2.x versions of Chef. The gem needs to be
25
+ installed into the omnibus like so:
26
+
27
+ ```
28
+ $ /opt/chef/emebedded/bin/gem install batali-wedge --no-document
29
+ ```
30
+
31
+ Then you can enable it via the `client.rb` file by adding this to
32
+ the top:
33
+
34
+ ```ruby
35
+ # /etc/chef/client.rb
36
+
37
+ require 'batali-wedge/sync'
38
+ ```
39
+
40
+ ## What does this provide?
41
+
42
+ Cookbook resolution, just on the client, via Batali. There's no
43
+ least impact yet, but mostly because this was a first pass to
44
+ see _if_ it would work. The next release will likely include
45
+ that feature just to see what happens.
46
+
47
+ # Info
48
+
49
+ * Repository: https://github.com/hw-labs/batali-wedge
50
+ * IRC: Freenode @ #heavywater
@@ -60,6 +60,8 @@ class Chef::PolicyBuilder::ExpandNodeObject
60
60
  results = solver.generate!
61
61
  solution = results.pop
62
62
  solution_output = solution.units.sort_by(&:name).map{|u| "#{u.name}<#{u.version}>"}.join(', ')
63
+ node.set[:batali] ||= Mash.new
64
+ node.set[:batali][:last_resolution] = Mash[solution.map{|u| [u.name, u.version]}]
63
65
  Chef::Log.warn "Batali cookbook resolution: #{solution_output}"
64
66
  Hash[
65
67
  solution.units.map do |unit|
@@ -1,3 +1,3 @@
1
1
  module BataliWedge
2
- VERSION = Gem::Version.new('0.0.4')
2
+ VERSION = Gem::Version.new('0.1.0')
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batali-wedge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts