pupcap 0.3.0 → 0.3.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/bin/pupcap +1 -4
- data/lib/pupcap/action/apply/Capfile +1 -1
- data/lib/pupcap/action/init/prepare.sh.erb +1 -1
- data/lib/pupcap/cli.rb +22 -4
- data/lib/pupcap/version.rb +1 -1
- data/pupcap.gemspec +0 -1
- metadata +1 -17
data/bin/pupcap
CHANGED
@@ -52,7 +52,7 @@ apt-get -qy update > /dev/null
|
|
52
52
|
apt-get install -qy rsync wget rubygems vim git-core build-essential > /dev/null
|
53
53
|
apt-get -qy clean
|
54
54
|
|
55
|
-
/usr/bin/gem install -q --no-ri --no-rdoc --version '~>
|
55
|
+
/usr/bin/gem install -q --no-ri --no-rdoc --version '~> 3.0.0' puppet
|
56
56
|
/usr/bin/gem install -q --no-ri --no-rdoc librarian-puppet
|
57
57
|
|
58
58
|
/usr/sbin/groupadd -f puppet
|
data/lib/pupcap/cli.rb
CHANGED
@@ -19,7 +19,7 @@ class Pupcap::CLI < Thor
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
desc "
|
22
|
+
desc "[TASKS] prepare", "Prepare target host"
|
23
23
|
method_option :file, :type => :string, :default => File.expand_path("Capfile"),
|
24
24
|
:desc => "Capfile"
|
25
25
|
method_option :script, :type => :string, :default => File.expand_path("prepare.sh.erb"),
|
@@ -40,14 +40,14 @@ class Pupcap::CLI < Thor
|
|
40
40
|
cap_execute_tasks(capfile("prepare"), tasks << "prepare")
|
41
41
|
end
|
42
42
|
|
43
|
-
desc "
|
43
|
+
desc "[TASKS] apply", "Puppet apply"
|
44
44
|
method_option :file, :type => :string, :default => File.expand_path("Capfile"),
|
45
45
|
:desc => "Capfile"
|
46
46
|
def apply(*tasks)
|
47
47
|
cap_execute_tasks(capfile("apply"), tasks << "apply")
|
48
48
|
end
|
49
49
|
|
50
|
-
desc "
|
50
|
+
desc "[TASKS] noop", "Puppet noop"
|
51
51
|
method_option :file, :type => :string, :default => File.expand_path("Capfile"),
|
52
52
|
:desc => "Capfile"
|
53
53
|
def noop(*tasks)
|
@@ -55,7 +55,7 @@ class Pupcap::CLI < Thor
|
|
55
55
|
apply(*tasks)
|
56
56
|
end
|
57
57
|
|
58
|
-
desc "
|
58
|
+
desc "[TASKS] ssh", "Open remote console"
|
59
59
|
method_option :file, :type => :string, :default => File.expand_path("Capfile"),
|
60
60
|
:desc => "Capfile"
|
61
61
|
def ssh(*tasks)
|
@@ -66,6 +66,24 @@ class Pupcap::CLI < Thor
|
|
66
66
|
File.dirname(__FILE__)
|
67
67
|
end
|
68
68
|
|
69
|
+
def self.revert_argv_and_start(argv = ARGV)
|
70
|
+
need_to_revert = %w{ noop apply init prepare ssh }
|
71
|
+
if need_to_revert.include?(argv.last) || argv.size > 1
|
72
|
+
last = argv.pop
|
73
|
+
argv = [last] + argv
|
74
|
+
end
|
75
|
+
begin
|
76
|
+
start(argv)
|
77
|
+
rescue Exception => e
|
78
|
+
if ENV['THOR_DEBUG'] == '1'
|
79
|
+
raise e
|
80
|
+
else
|
81
|
+
$stderr.puts e.message
|
82
|
+
exit 1
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
69
87
|
private
|
70
88
|
def capfile(name)
|
71
89
|
self.class.source_root + "/action/#{name}/Capfile"
|
data/lib/pupcap/version.rb
CHANGED
data/pupcap.gemspec
CHANGED
@@ -20,6 +20,5 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_runtime_dependency("capistrano", [">= 2.12.0"])
|
21
21
|
s.add_runtime_dependency("vagrant", [">= 1.0.0"])
|
22
22
|
s.add_runtime_dependency("librarian-puppet", [">= 0.9.7"])
|
23
|
-
s.add_runtime_dependency("net-ssh-multi", [">= 1.1.0"])
|
24
23
|
s.add_runtime_dependency("thor", [">= 0"])
|
25
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pupcap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -59,22 +59,6 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.9.7
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: net-ssh-multi
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: 1.1.0
|
70
|
-
type: :runtime
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 1.1.0
|
78
62
|
- !ruby/object:Gem::Dependency
|
79
63
|
name: thor
|
80
64
|
requirement: !ruby/object:Gem::Requirement
|