cap_puppet 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
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
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cap_puppet.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 David Biehl
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,77 @@
1
+ # CapPuppet
2
+
3
+ Apply local Puppet manifests when deploying your project with Capistrano.
4
+
5
+ ## Disclaimer
6
+
7
+ This is still in very early stages of development.
8
+ I have only tested this on a local prototype project, and so far it appears to be working according to this document.
9
+ I already have a few ideas that will dramatically change the way this currently works.
10
+ *Use at your own risk, there will be updates soon*
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ gem 'cap_puppet'
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install cap_puppet
25
+
26
+ ## Usage
27
+
28
+ This assumes that you've "capified" your application.
29
+
30
+ Simply include the CapPuppet recipe inside of `config/deploy.rb` like so:
31
+
32
+ require "cap_puppet/capistrano"
33
+
34
+ The default values assume the following files and directories exist:
35
+
36
+ config/puppet/manifests/default.pp
37
+ config/puppet/modules
38
+
39
+ The `default.pp` is the manifest that will be executed after `deploy:update_code`
40
+ Any required modules can be placed inside of the modules directory.
41
+
42
+ ### Settings
43
+
44
+ If you're not fond of the default values, there are some setting to override them:
45
+
46
+ puppet_path:
47
+ Default Value: `release_path`/config/puppet
48
+ The base path for Puppet manifests and modules.
49
+ Expects the puppet_path to have ./modules and ./manifests
50
+
51
+ puppet_command:
52
+ Default Value: puppet
53
+ The command to execute Puppet.
54
+
55
+ puppet_modules_path:
56
+ Default Value: `puppet_path`/modules
57
+ The path where the Puppet modules are stored.
58
+
59
+ puppet_manifests_path:
60
+ Default Value: `puppet_path`/manifests
61
+ The path where the Puppet manifests are stored.
62
+
63
+ puppet_manifest:
64
+ Default Value: `puppet_manifest_path`/default.pp
65
+ The manifest that should be applied in the `puppet_manifest_path`
66
+
67
+ ## Contributing
68
+
69
+ 1. Fork it
70
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
71
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
72
+ 4. Push to the branch (`git push origin my-new-feature`)
73
+ 5. Create new Pull Request
74
+
75
+ ## License
76
+
77
+ MIT
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,17 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/cap_puppet/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["David Biehl"]
6
+ gem.email = ["me@davidbiehl.com"]
7
+ gem.description = %q{Apply a local Puppet manifest when deploying with Capistrano}
8
+ gem.summary = %q{Apply a local Puppet manifest when deploying with Capistrano}
9
+ gem.homepage = "https://github.com/davidbiehl/cap_puppet"
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "cap_puppet"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = CapPuppet::VERSION
17
+ end
data/lib/cap_puppet.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "cap_puppet/version"
2
+
3
+ module CapPuppet
4
+
5
+ end
@@ -0,0 +1,42 @@
1
+ # A Capistrano recipe for applying Puppet manifests from the local project
2
+
3
+ Capistrano::Configuration.instance(:must_exist).load do
4
+
5
+ _cset(:puppet_command) { "puppet" }
6
+ _cset(:puppet_path) { File.join(release_path, "config", "puppet") }
7
+ _cset(:puppet_modules_path) { File.join(puppet_path, "modules") }
8
+ _cset(:puppet_manifests_path) { File.join(puppet_path, "manifests") }
9
+ _cset(:puppet_manifest) { "default.pp" }
10
+
11
+ namespace :puppet do
12
+ desc <<-DESC
13
+ Applies a Puppet manifest, like a boss.
14
+
15
+ puppet_path:
16
+ Default Value: `release_path`/config/puppet
17
+ The base path for Puppet manifests and modules.
18
+ Expects the puppet_path to have ./modules and ./manifests
19
+
20
+ puppet_command:
21
+ Default Value: puppet
22
+ The command to execute Puppet.
23
+
24
+ puppet_modules_path:
25
+ Default Value: `puppet_path`/modules
26
+ The path where the Puppet modules are stored.
27
+
28
+ puppet_manifests_path:
29
+ Default Value: `puppet_path`/manifests
30
+ The path where the Puppet manifests are stored.
31
+
32
+ puppet_manifest:
33
+ Default Value: `puppet_manifest_path`/default.pp
34
+ The manifest that should be applied in the `puppet_manifest_path`
35
+ DESC
36
+ task :apply do
37
+ run "#{puppet_command} apply --modulepath=#{puppet_modules_path} #{File.join(puppet_manifests_path, puppet_manifest)}"
38
+ end
39
+ end
40
+
41
+ after "deploy:update_code", "puppet:apply"
42
+ end
@@ -0,0 +1,3 @@
1
+ module CapPuppet
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cap_puppet
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - David Biehl
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2013-08-01 00:00:00 +00:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: Apply a local Puppet manifest when deploying with Capistrano
23
+ email:
24
+ - me@davidbiehl.com
25
+ executables: []
26
+
27
+ extensions: []
28
+
29
+ extra_rdoc_files: []
30
+
31
+ files:
32
+ - .gitignore
33
+ - Gemfile
34
+ - LICENSE
35
+ - README.md
36
+ - Rakefile
37
+ - cap_puppet.gemspec
38
+ - lib/cap_puppet.rb
39
+ - lib/cap_puppet/capistrano.rb
40
+ - lib/cap_puppet/version.rb
41
+ has_rdoc: true
42
+ homepage: https://github.com/davidbiehl/cap_puppet
43
+ licenses: []
44
+
45
+ post_install_message:
46
+ rdoc_options: []
47
+
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ hash: 3
56
+ segments:
57
+ - 0
58
+ version: "0"
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ hash: 3
65
+ segments:
66
+ - 0
67
+ version: "0"
68
+ requirements: []
69
+
70
+ rubyforge_project:
71
+ rubygems_version: 1.3.7
72
+ signing_key:
73
+ specification_version: 3
74
+ summary: Apply a local Puppet manifest when deploying with Capistrano
75
+ test_files: []
76
+