vagrant-librarian-chef 0.0.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3497ada011a5d5276259eaf6f14a21798da85618
4
- data.tar.gz: 9fe602c0e7e23abad49fe0195274434afbef8cdd
3
+ metadata.gz: 0e9f3cbc24c33ba05d2e6d81dff49c9a64f30129
4
+ data.tar.gz: 2bd72d43a4a3722139ddd5aae8c7e940b1cd68db
5
5
  SHA512:
6
- metadata.gz: cf61da57ea8822c5111d45030b2738c4cda6c31c8c969ab654d4c18df42e5db8df7c13d8f20d810b7ee8a561c2ae478652c15c1e57657f215cf4a83a3dc43d2e
7
- data.tar.gz: da19c2e14e8693701e763eebadcbe6628aea27d8b8eb01995658d497b8d1b22bdeeed61873a832c01c7758cbee9279c605bb3220f5b84a053eccfe990d1f630b
6
+ metadata.gz: 66875978a48398ade12d140bf6b0868847a2856e6606835323e57b9da57b72a92f155a282528ce2719febbae0772ee32ec10c048049ce4292de9af8384ac00bd
7
+ data.tar.gz: 1975f3c8a5e62edab974a2388f840d6957f61799e9b10bbe7f20eeb182c22186b6f142b8bbf505dd6e2ab800b96bcfa4fff59886a64b9857511f70bc3d369991
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # vagrant-librarian-chef
2
2
 
3
- A [Vagrant](http://www.vagrantup.com/) plugin to install [Chef](http://www.opscode.com/chef/) cookbooks using [Librarian-Chef](https://github.com/applicationsonline/librarian-chef).
3
+ A [Vagrant](http://www.vagrantup.com/) plugin to install
4
+ [Chef](http://www.opscode.com/chef/) cookbooks using
5
+ [Librarian-Chef](https://github.com/applicationsonline/librarian-chef).
4
6
 
5
7
  ## Requirements
6
8
 
@@ -14,7 +16,27 @@ vagrant plugin install vagrant-librarian-chef
14
16
 
15
17
  ## Usage
16
18
 
17
- Vagrant will automatically run Librarian-Chef before any provisioning step, so simply set up your Cheffile as you normally would.
19
+ Vagrant will automatically run Librarian-Chef before any provisioning step, so
20
+ simply set up your Cheffile as you normally would.
21
+
22
+ You may specify the subdirectory within which to run `librarian-chef`
23
+ using the `librarian_chef.cheffile_dir` config key. Please keep in mind
24
+ that you will need to explicitly set the `cookbooks_path` in the
25
+ `:chef_solo` provisioner:
26
+
27
+ ```ruby
28
+ Vagrant.configure("2") do |config|
29
+
30
+ config.librarian_chef.cheffile_dir = "chef"
31
+
32
+ config.vm.provision :chef_solo do |chef|
33
+ chef.cookbooks_path = "chef/cookbooks"
34
+
35
+ ...
36
+
37
+ end
38
+ end
39
+ ```
18
40
 
19
41
  ## Development
20
42
 
@@ -25,4 +47,7 @@ bundle exec vagrant up
25
47
 
26
48
  ## Acknowledgements
27
49
 
28
- Thank you to @thegcat and other contributors for their work on [vagrant-librarian](https://github.com/thegcat/vagrant-librarian), an earlier version of this functionality for Vagrant 1.0.x and the original Librarian gem with integrated Librarian-Chef.
50
+ Thank you to @thegcat and other contributors for their work on
51
+ [vagrant-librarian](https://github.com/thegcat/vagrant-librarian), an earlier
52
+ version of this functionality for Vagrant 1.0.x and the original Librarian gem
53
+ with integrated Librarian-Chef.
@@ -7,13 +7,18 @@ module VagrantPlugins
7
7
  class Install
8
8
  def initialize(app, env)
9
9
  @app = app
10
+ # Config#finalize! SHOULD be called automatically
11
+ env[:global_config].librarian_chef.finalize!
10
12
  end
11
13
 
12
14
  def call(env)
13
- # look for a Cheffile in the Vagrant root_path
14
- if FileTest.exist?(env[:root_path] + "Cheffile")
15
+ config = env[:global_config].librarian_chef
16
+ # look for a Cheffile in the configured cheffile_dir
17
+ if FileTest.exist? File.join(env[:root_path], config.cheffile_path)
15
18
  env[:ui].info "Installing Chef cookbooks with Librarian-Chef..."
16
- environment = Librarian::Chef::Environment.new
19
+ environment = Librarian::Chef::Environment.new({
20
+ :project_path => config.cheffile_dir
21
+ })
17
22
  Librarian::Action::Ensure.new(environment).run
18
23
  Librarian::Action::Resolve.new(environment).run
19
24
  Librarian::Action::Install.new(environment).run
@@ -0,0 +1,19 @@
1
+ module VagrantPlugins
2
+ module LibrarianChef
3
+ class Config < Vagrant.plugin(2, :config)
4
+ attr_accessor :cheffile_dir
5
+
6
+ def initialize
7
+ @cheffile_dir = UNSET_VALUE
8
+ end
9
+
10
+ def finalize!
11
+ @cheffile_dir = nil if @cheffile_dir == UNSET_VALUE
12
+ end
13
+
14
+ def cheffile_path
15
+ @cheffile_path ||= @cheffile_dir ? File.join(@cheffile_dir, 'Cheffile') : 'Cheffile'
16
+ end
17
+ end
18
+ end
19
+ end
@@ -16,6 +16,11 @@ DESC
16
16
  action_hook "librarian_chef" do |hook|
17
17
  hook.before Vagrant::Action::Builtin::Provision, Action::Install
18
18
  end
19
+
20
+ config "librarian_chef" do
21
+ require_relative "config"
22
+ Config
23
+ end
19
24
  end
20
25
  end
21
26
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module LibrarianChef
3
- VERSION = "0.0.2"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-librarian-chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Cuadra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-19 00:00:00.000000000 Z
11
+ date: 2013-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: librarian-chef
@@ -82,6 +82,7 @@ files:
82
82
  - Vagrantfile
83
83
  - lib/vagrant-librarian-chef.rb
84
84
  - lib/vagrant-librarian-chef/action/librarian_chef.rb
85
+ - lib/vagrant-librarian-chef/config.rb
85
86
  - lib/vagrant-librarian-chef/plugin.rb
86
87
  - lib/vagrant-librarian-chef/version.rb
87
88
  - vagrant-librarian-chef.gemspec