vagrant-librarian-chef-nochef 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c56fc54b783d7d3ff6a8869d7559dc3f7c42dbca
4
+ data.tar.gz: 61f107619c11db51c5cd275a2a533bbf7003dd4c
5
+ SHA512:
6
+ metadata.gz: e24f1ca9394b030b22b913af945023b38e07884016734376cdcdbde5c43fd7bea8f055ffc7548dc4980ae6300894cfbca274a65bc116f8be307ee51835942226
7
+ data.tar.gz: bce9dd2633fe89696c3d64b679185080eebfb93f20cd266670f793a21c1cbe371bf04d9f6fe5c225b3fa22e853d74cc557f740956d40a2cfc79eaa41acf5ced7
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ Cheffile.lock
19
+ cookbooks
20
+ .vagrant
data/Cheffile ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ #^syntax detection
3
+
4
+ site 'http://community.opscode.com/api/v1'
5
+
6
+ cookbook "git"
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem "vagrant", github: "mitchellh/vagrant"
7
+ gem "vagrant-vmware-fusion"
8
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Jimmy Cuadra
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # vagrant-librarian-chef-nochef
2
+
3
+ A fork of the [vagrant-librarian-chef](https://github.com/jimmycuadra/vagrant-librarian-chef)
4
+ plugin that use the [librarian-chef-nochef](https://github.com/emyl/librarian-chef-nochef) gem,
5
+ thus doesn't depend on chef.
6
+
7
+ Install running:
8
+
9
+ $ vagrant plugin install vagrant-librarian-chef-nochef
10
+
11
+ Below the original vagrant-librarian-chef README:
12
+
13
+ =========
14
+
15
+ A [Vagrant](http://www.vagrantup.com/) plugin to install
16
+ [Chef](http://www.opscode.com/chef/) cookbooks using
17
+ [Librarian-Chef](https://github.com/applicationsonline/librarian-chef).
18
+
19
+ ## Requirements
20
+
21
+ * Vagrant version 1.2.0 or greater.
22
+
23
+ ## Installation
24
+
25
+ ``` bash
26
+ vagrant plugin install vagrant-librarian-chef
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ Vagrant will automatically run Librarian-Chef before any provisioning step, so
32
+ simply set up your Cheffile as you normally would.
33
+
34
+ You may specify the subdirectory within which to run `librarian-chef`
35
+ using the `librarian_chef.cheffile_dir` config key. Please keep in mind
36
+ that you will need to explicitly set the `cookbooks_path` in the
37
+ `:chef_solo` provisioner:
38
+
39
+ ```ruby
40
+ Vagrant.configure("2") do |config|
41
+
42
+ config.librarian_chef.cheffile_dir = "chef"
43
+
44
+ config.vm.provision :chef_solo do |chef|
45
+ chef.cookbooks_path = "chef/cookbooks"
46
+
47
+ ...
48
+
49
+ end
50
+ end
51
+ ```
52
+
53
+ ## Development
54
+
55
+ ``` bash
56
+ bundle
57
+ bundle exec vagrant up
58
+ ```
59
+
60
+ ## Acknowledgements
61
+
62
+ Thank you to @thegcat and other contributors for their work on
63
+ [vagrant-librarian](https://github.com/thegcat/vagrant-librarian), an earlier
64
+ version of this functionality for Vagrant 1.0.x and the original Librarian gem
65
+ with integrated Librarian-Chef.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/Vagrantfile ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- mode: ruby -*-
3
+ # vi: set ft=ruby :
4
+
5
+ require "vagrant-vmware-fusion"
6
+
7
+ Vagrant.configure("2") do |config|
8
+ config.vm.box = "precise64"
9
+ config.vm.box_url = "http://files.vagrantup.com/precise64.box"
10
+
11
+ # To develop against the VMware Fusion provider, you must set an environment variable
12
+ # pointing to the officially installed Vagrant. You must also be running the same version
13
+ # of Ruby.
14
+ #
15
+ # $ VAGRANT_INSTALLER_EMBEDDED_DIR=/Applications/Vagrant/embedded bundle exec vagrant
16
+ config.vm.provider :vmware_fusion do |v, override|
17
+ override.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
18
+ end
19
+
20
+ config.vm.provision :chef_solo do |chef|
21
+ chef.cookbooks_path = "cookbooks"
22
+ chef.add_recipe "git"
23
+ end
24
+ end
@@ -0,0 +1 @@
1
+ require "vagrant-librarian-chef"
@@ -0,0 +1,2 @@
1
+ require "vagrant-librarian-chef/version"
2
+ require "vagrant-librarian-chef/plugin"
@@ -0,0 +1,43 @@
1
+ require "librarian-chef"
2
+ require "librarian/action"
3
+
4
+ module VagrantPlugins
5
+ module LibrarianChef
6
+ module Action
7
+ class Install
8
+ def initialize(app, env)
9
+ @app = app
10
+ # Config#finalize! SHOULD be called automatically
11
+ env[:global_config].librarian_chef.finalize!
12
+ end
13
+
14
+ def call(env)
15
+ config = env[:global_config].librarian_chef
16
+
17
+ project_path = get_project_path(env, config)
18
+ if project_path
19
+ env[:ui].info "Installing Chef cookbooks with Librarian-Chef..."
20
+ environment = Librarian::Chef::Environment.new({
21
+ :project_path => project_path
22
+ })
23
+ Librarian::Action::Ensure.new(environment).run
24
+ Librarian::Action::Resolve.new(environment).run
25
+ Librarian::Action::Install.new(environment).run
26
+ else
27
+ env[:ui].info "Couldn't find Cheffile at #{config.cheffile_path}."
28
+ end
29
+ @app.call(env)
30
+ end
31
+
32
+ def get_project_path(env, config)
33
+ # look for a Cheffile in the configured cheffile_dir
34
+ if FileTest.exist? File.join(env[:root_path], config.cheffile_path)
35
+ return File.join(env[:root_path], config.cheffile_dir)
36
+ elsif FileTest.exist? File.expand_path(config.cheffile_path)
37
+ return File.expand_path(config.cheffile_dir)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -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 = "." 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
@@ -0,0 +1,26 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ abort "vagrant-librarian-chef must be loaded in a Vagrant environment."
5
+ end
6
+
7
+ require "vagrant-librarian-chef/action/librarian_chef"
8
+
9
+ module VagrantPlugins
10
+ module LibrarianChef
11
+ class Plugin < Vagrant.plugin("2")
12
+ name "vagrant-librarian-chef"
13
+ description <<-DESC
14
+ A Vagrant plugin to install Chef cookbooks using Librarian-Chef.
15
+ DESC
16
+ action_hook "librarian_chef" do |hook|
17
+ hook.before Vagrant::Action::Builtin::Provision, Action::Install
18
+ end
19
+
20
+ config "librarian_chef" do
21
+ require_relative "config"
22
+ Config
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module LibrarianChef
3
+ VERSION = "0.1.4"
4
+ end
5
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "vagrant-librarian-chef-nochef"
7
+ spec.version = "0.1.0"
8
+ spec.authors = ["Emiliano Ticci", "Jimmy Cuadra"]
9
+ spec.email = ["emiticci@gmail.com" "jimmy@jimmycuadra.com"]
10
+ spec.description = %q{A Vagrant plugin to install Chef cookbooks using librarian-chef-nochef.}
11
+ spec.summary = %q{A Vagrant plugin to install Chef cookbooks using librarian-chef-nochef.}
12
+ spec.homepage = "https://github.com/emyl/vagrant-librarian-chef-nochef"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_runtime_dependency "librarian-chef-nochef"
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "rspec"
24
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-librarian-chef-nochef
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Emiliano Ticci
8
+ - Jimmy Cuadra
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-03-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: librarian-chef-nochef
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: '1.3'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: '1.3'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ description: A Vagrant plugin to install Chef cookbooks using librarian-chef-nochef.
71
+ email:
72
+ - emiticci@gmail.comjimmy@jimmycuadra.com
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - Cheffile
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - Vagrantfile
84
+ - lib/vagrant-librarian-chef-nochef.rb
85
+ - lib/vagrant-librarian-chef.rb
86
+ - lib/vagrant-librarian-chef/action/librarian_chef.rb
87
+ - lib/vagrant-librarian-chef/config.rb
88
+ - lib/vagrant-librarian-chef/plugin.rb
89
+ - lib/vagrant-librarian-chef/version.rb
90
+ - vagrant-librarian-chef-nochef.gemspec
91
+ homepage: https://github.com/emyl/vagrant-librarian-chef-nochef
92
+ licenses:
93
+ - MIT
94
+ metadata: {}
95
+ post_install_message:
96
+ rdoc_options: []
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ requirements: []
110
+ rubyforge_project:
111
+ rubygems_version: 2.0.14
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: A Vagrant plugin to install Chef cookbooks using librarian-chef-nochef.
115
+ test_files: []