capistrano-chef-solo 0.0.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.
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 'http://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-chef-solo.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.authors = ["Chris Mytton"]
5
+ gem.email = ["self@hecticjeff.net"]
6
+ gem.description = %q{Capistrano tasks for chef-solo}
7
+ gem.summary = %q{Bootstrap and run chef-solo remotely using Capistrano}
8
+ gem.homepage = ""
9
+
10
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
11
+ gem.files = `git ls-files`.split("\n")
12
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
13
+ gem.name = "capistrano-chef-solo"
14
+ gem.require_paths = ["lib"]
15
+ gem.version = "0.0.1"
16
+
17
+ gem.add_dependency "capistrano", "~> 2.0"
18
+ gem.add_development_dependency "rake"
19
+ end
@@ -0,0 +1 @@
1
+ require "capistrano/chef/solo"
@@ -0,0 +1,58 @@
1
+ Capistrano::Configuration.instance.load do
2
+ set(:cookbook_path, 'chef/cookbooks') unless exists?(:cookbook_path)
3
+ set(:node_json_path, 'chef/node.json') unless exists?(:node_json_path)
4
+
5
+ namespace :chef do
6
+ desc "Bootstrap a fresh server with chef"
7
+ task :bootstrap do
8
+ chef.ssh.transfer_keys
9
+ run "curl -fsSL opscode.com/chef/install.sh | bash"
10
+ chef.default
11
+ end
12
+
13
+ desc "Do a chef-solo run on the remote servers"
14
+ task :default do
15
+ chef.setup
16
+ run "#{sudo} chef-solo -j node.json -r chef-solo.tar.gz"
17
+ end
18
+
19
+ task :setup do
20
+ chef.cookbooks
21
+ chef.node
22
+ end
23
+
24
+ task :cookbooks do
25
+ system "tar -zcf chef-solo.tar.gz #{cookbook_path}"
26
+ upload "chef-solo.tar.gz", "chef-solo.tar.gz"
27
+ system "rm chef-solo.tar.gz"
28
+ end
29
+
30
+ task :node do
31
+ upload node_json_path, "node.json"
32
+ end
33
+
34
+ namespace :ssh do
35
+ desc "Transfer SSH keys to the remote server"
36
+ task :transfer_keys do
37
+ public_key = ssh_authorized_pub_file rescue false
38
+ known_hosts = ssh_known_hosts rescue false
39
+ if public_key || known_hosts
40
+ run "mkdir -p ~/.ssh"
41
+ put(File.read(public_key), ".ssh/authorized_keys", :mode => "0600") if public_key
42
+ put(known_hosts, ".ssh/known_hosts", :mode => "0600") if known_hosts
43
+ end
44
+ end
45
+
46
+ desc "Set any defined SSH options"
47
+ task :set_options do
48
+ ssh_options[:paranoid] = ssh_options_paranoid rescue nil
49
+ ssh_options[:keys] = ssh_options_keys rescue nil
50
+ ssh_options[:forward_agent] = ssh_options_forward_agent rescue nil
51
+ ssh_options[:username] = ssh_options_username rescue user rescue nil
52
+ ssh_options[:port] = ssh_options_port rescue nil
53
+ end
54
+ end
55
+
56
+ before "ssh:transfer_keys", "ssh:set_options"
57
+ end
58
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-chef-solo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Chris Mytton
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-12-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: capistrano
16
+ requirement: &70159715223520 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '2.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70159715223520
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &70159715222740 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70159715222740
36
+ description: Capistrano tasks for chef-solo
37
+ email:
38
+ - self@hecticjeff.net
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - .gitignore
44
+ - Gemfile
45
+ - Rakefile
46
+ - capistrano-chef-solo.gemspec
47
+ - lib/capistrano-chef-solo.rb
48
+ - lib/capistrano/chef/solo.rb
49
+ homepage: ''
50
+ licenses: []
51
+ post_install_message:
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ segments:
62
+ - 0
63
+ hash: -647457430553181309
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ segments:
71
+ - 0
72
+ hash: -647457430553181309
73
+ requirements: []
74
+ rubyforge_project:
75
+ rubygems_version: 1.8.11
76
+ signing_key:
77
+ specification_version: 3
78
+ summary: Bootstrap and run chef-solo remotely using Capistrano
79
+ test_files: []