vagrant-librarian-puppet-plugin 0.1.1

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,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzM2YzVhZDk5N2Y4OWY4YjYwOTJlY2IxMTJjNWNlZmRiMmIyY2ExZA==
5
+ data.tar.gz: !binary |-
6
+ ZjY2Nzc5MzljNTg2N2FmMWUwNWE3ZDZiOGY4NzJkZjhmZjc5M2ViYQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ OGYwNzlhODdmOTdkYjE0ZjBmYmI5YjJjM2I4NmYwM2U1OGY3NGM4OTY0YmU0
10
+ ZmQ0OTgyZDk1ZDVhNjhjODM5Y2E4NzA0NDg5MjRkZTNlYjA2MDU5MWNjZmI3
11
+ OTM3NGYyYWU3ZTA1MGU5MTJiMmQxNWNkYTliZGVhYWEyYWNlOTA=
12
+ data.tar.gz: !binary |-
13
+ YjRiZDA5OTUzZjNhZjEyMjk4MTVlMWRiMWIzZDFiYTM3Y2Q0YWVmN2VlMWM4
14
+ Zjg0NDdlZTVlNjg3N2RhMmQ1NTZhMjc3NDEwNmJmZDM0OGUwZDY4Mjc0ZWNj
15
+ ZDUyZWZjYzE5YjFkMDljY2MyMGQyMTY4MzljMTE4ODlmZDg0NmY=
data/.gitignore ADDED
@@ -0,0 +1,21 @@
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
+ Puppetfile.lock
19
+ modules
20
+ .vagrant
21
+ .tmp
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 "debugger"
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/Puppetfile ADDED
@@ -0,0 +1,6 @@
1
+ # Manage Puppet module dependencies with librarian-puppet
2
+
3
+ forge 'http://forge.puppetlabs.com'
4
+
5
+ mod 'supervisor',
6
+ :git => 'git://github.com/eventbrite/puppet-supervisor.git'
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # vagrant-librarian-puppet-plugin
2
+
3
+ A [Vagrant](http://www.vagrantup.com/) plugin to install
4
+ [Puppet](http://docs.puppetlabs.com/#puppetpuppet) modules using
5
+ [Librarian-Puppet](https://github.com/rodjek/librarian-puppet).
6
+
7
+ ## Requirements
8
+
9
+ * Vagrant version 1.2.0 or greater.
10
+
11
+ ## Installation
12
+
13
+ ``` bash
14
+ vagrant plugin install vagrant-librarian-puppet-plugin
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Vagrant will automatically run Librarian-Puppet before any provisioning step, so
20
+ simply set up your Puppetfile as you normally would.
21
+
22
+ You may specify the subdirectory within which to run `librarian-puppet`
23
+ using the `librarian_puppet.puppetfile_dir` config key. Please keep in mind
24
+ that you will need to explicitly set the `modules` path in the
25
+ `:puppet` provisioner and this path must exist before running vagrant commands:
26
+
27
+ ```ruby
28
+ Vagrant.configure("2") do |config|
29
+
30
+ config.librarian_puppet.puppetfile_dir = "puppet"
31
+
32
+ config.vm.provision :puppet do |puppet|
33
+ puppet.modules = "puppet/modules"
34
+
35
+ ...
36
+
37
+ end
38
+ end
39
+ ```
40
+
41
+ ## Development
42
+
43
+ ``` bash
44
+ bundle
45
+ bundle exec vagrant up
46
+ ```
47
+
48
+ ## Acknowledgements
49
+
50
+ Thanks be to @jimmycuadra and other contributors for their work on
51
+ [vagrant-librarian-chef](https://github.com/jimmycuadra/vagrant-librarian-chef).
52
+ This plugin made some slight changes to work with puppet, but largely just used
53
+ their code.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/Vagrantfile ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- mode: ruby -*-
3
+ # vi: set ft=ruby :
4
+
5
+ Vagrant.require_plugin "vagrant-librarian-puppet-plugin"
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
+ config.vm.provision :puppet do |puppet|
12
+ puppet.manifests_path = "manifests"
13
+ puppet.manifest_file = "init.pp"
14
+ puppet.module_path = "modules"
15
+ end
16
+
17
+ end
@@ -0,0 +1,2 @@
1
+ require "vagrant-librarian-puppet-plugin/version"
2
+ require "vagrant-librarian-puppet-plugin/plugin"
@@ -0,0 +1,39 @@
1
+ require 'librarian/puppet'
2
+ require 'librarian/action'
3
+
4
+ module VagrantPlugins
5
+ module LibrarianPuppet
6
+ module Action
7
+ class Install
8
+ def initialize(app, env)
9
+ @app = app
10
+ @env = env
11
+ # Config#finalize! SHOULD be called automatically
12
+ env[:global_config].librarian_puppet.finalize!
13
+ end
14
+
15
+ def call(env)
16
+ config = env[:global_config].librarian_puppet
17
+ if
18
+ provisioned? and
19
+ File.exist? File.join(env[:root_path], config.puppetfile_path)
20
+
21
+ env[:ui].info "Installing Puppet modules with Librarian-Puppet..."
22
+ environment = Librarian::Puppet::Environment.new({
23
+ :project_path => File.join(env[:root_path], config.librarian_dir)
24
+ })
25
+ Librarian::Action::Ensure.new(environment).run
26
+ Librarian::Action::Resolve.new(environment).run
27
+ Librarian::Action::Install.new(environment).run
28
+ end
29
+ @app.call(env)
30
+ end
31
+
32
+ def provisioned?
33
+ @env[:provision_enabled].nil? ? true : @env[:provision_enabled]
34
+ end
35
+
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,20 @@
1
+ module VagrantPlugins
2
+ module LibrarianPuppet
3
+ class Config < Vagrant.plugin(2, :config)
4
+ attr_accessor :librarian_dir
5
+
6
+ def initialize
7
+ @librarian_dir = UNSET_VALUE
8
+ end
9
+
10
+ def finalize!
11
+ @librarian_dir = "." if @librarian_dir == UNSET_VALUE
12
+ end
13
+
14
+ def puppetfile_path
15
+ @puppetfile_path ||= @librarian_dir ? File.join(@librarian_dir, 'Puppetfile') : 'Puppetfile'
16
+ end
17
+
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,28 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ abort "vagrant-librarian-puppet-plugin must be loaded in a Vagrant environment."
5
+ end
6
+
7
+ require "vagrant-librarian-puppet-plugin/action/librarian_puppet"
8
+
9
+
10
+ module VagrantPlugins
11
+ module LibrarianPuppet
12
+ class Plugin < Vagrant.plugin("2")
13
+ name "vagrant-librarian-puppet-plugin"
14
+ description <<-DESC
15
+ A Vagrant plugin to install Puppet modules using Librarian-Puppet.
16
+ DESC
17
+ action_hook "librarian_puppet" do |hook|
18
+ # XXX see if we can only hook so long as a command option isn't passed
19
+ hook.before Vagrant::Action::Builtin::Provision, Action::Install
20
+ end
21
+
22
+ config "librarian_puppet" do
23
+ require_relative "config"
24
+ Config
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module LibrarianPuppet
3
+ VERSION = "0.1.1"
4
+ end
5
+ end
data/manifests/init.pp ADDED
@@ -0,0 +1,5 @@
1
+ class dev {
2
+
3
+ }
4
+
5
+ include dev
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-librarian-puppet-plugin/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-librarian-puppet-plugin"
8
+ spec.version = VagrantPlugins::LibrarianPuppet::VERSION
9
+ spec.authors = ["Michael Hahn"]
10
+ spec.email = ["mwhahn@gmail.com"]
11
+ spec.description = %q{A Vagrant plugin to install Puppet modules using Librarian-Puppet.}
12
+ spec.summary = %q{A Vagrant plugin to install Puppet modules using Librarian-Puppet.}
13
+ # XXX update this url
14
+ spec.homepage = "https://github.com/mhahn/vagrant-librarian-puppet-plugin"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files`.split($/)
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_runtime_dependency "librarian-puppet"
23
+ spec.add_runtime_dependency "librarian"
24
+ spec.add_runtime_dependency "puppet"
25
+ spec.add_development_dependency "bundler", "~> 1.3"
26
+ spec.add_development_dependency "rake"
27
+ spec.add_development_dependency "rspec"
28
+ end
metadata ADDED
@@ -0,0 +1,142 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-librarian-puppet-plugin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Michael Hahn
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: librarian-puppet
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: librarian
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: puppet
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: A Vagrant plugin to install Puppet modules using Librarian-Puppet.
98
+ email:
99
+ - mwhahn@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - .gitignore
105
+ - Gemfile
106
+ - LICENSE.txt
107
+ - Puppetfile
108
+ - README.md
109
+ - Rakefile
110
+ - Vagrantfile
111
+ - lib/vagrant-librarian-puppet-plugin.rb
112
+ - lib/vagrant-librarian-puppet-plugin/action/librarian_puppet.rb
113
+ - lib/vagrant-librarian-puppet-plugin/config.rb
114
+ - lib/vagrant-librarian-puppet-plugin/plugin.rb
115
+ - lib/vagrant-librarian-puppet-plugin/version.rb
116
+ - manifests/init.pp
117
+ - vagrant-librarian-puppet-plugin.gemspec
118
+ homepage: https://github.com/mhahn/vagrant-librarian-puppet-plugin
119
+ licenses:
120
+ - MIT
121
+ metadata: {}
122
+ post_install_message:
123
+ rdoc_options: []
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ! '>='
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ! '>='
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ requirements: []
137
+ rubyforge_project:
138
+ rubygems_version: 2.0.5
139
+ signing_key:
140
+ specification_version: 4
141
+ summary: A Vagrant plugin to install Puppet modules using Librarian-Puppet.
142
+ test_files: []