batali-wedge 0.0.4 → 0.1.0
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/CHANGELOG.md +2 -0
- data/README.md +50 -0
- data/lib/batali-wedge/sync.rb +2 -0
- data/lib/batali-wedge/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6f124231d53d1814403f5400386e24a8545241d
|
4
|
+
data.tar.gz: 62d952e59accd7f3f5e1612a599f1a68ed11ddc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d29e1eb3dfd9b83bdb99c2c20dd577ae15602c9fad0bec2451e9d2ce54157b049cb871de5a155ea5ee553bf4c6ed6bb67b5ce5575ee44d187096f655e517512
|
7
|
+
data.tar.gz: b136b66efd8da4256ed80410cad2c7f1d76ba97cb99db12481b8c86345098d1e4fe00e4745f9182d23ca882c7c31a22c0f66cee0621d386454c7910e7e2547e9
|
data/CHANGELOG.md
CHANGED
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
|
data/lib/batali-wedge/sync.rb
CHANGED
@@ -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|
|
data/lib/batali-wedge/version.rb
CHANGED