opskeleton 0.6.3 → 0.6.4
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/opskeleton/version.rb +1 -1
- data/templates/chef/Rakefile +23 -9
- data/templates/parent/spec/default/{httpd_spec.rb → stub_spec.rb} +0 -0
- data/templates/parent/spec/spec_helper.rb +19 -32
- data/templates/puppet/Rakefile +26 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0ce97c953f80ab8ee81d8702974054793781cf6
|
4
|
+
data.tar.gz: 7fde5abe563d7a19aa1fe909e43d44d3000b81c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55f8f738ce76f66d382aecc2ae553070a2305f5d9cd859f5a99ade740ba825431a75a8e8bfe0b53910bd9c2c4a812fe1395d762a357d7012375a305df480c2de
|
7
|
+
data.tar.gz: 04327c6ca106b4c777bfaab9ae84d3b9c8ede2f16689a918e320d923f4d0094314caf882f4ecf69ba9296b7aa25f5195e7dc94391754205e1eb080557d5cd84c
|
data/Gemfile.lock
CHANGED
data/lib/opskeleton/version.rb
CHANGED
data/templates/chef/Rakefile
CHANGED
@@ -7,14 +7,28 @@ end
|
|
7
7
|
|
8
8
|
task :default => :spec
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
desc "Run serverspec to all hosts"
|
11
|
+
task :spec => 'serverspec:all'
|
12
|
+
|
13
|
+
class ServerspecTask < RSpec::Core::RakeTask
|
14
|
+
|
15
|
+
attr_accessor :target
|
16
|
+
|
17
|
+
def spec_command
|
18
|
+
cmd = super
|
19
|
+
"env TARGET_HOST=#{target} #{cmd}"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
namespace :serverspec do
|
25
|
+
|
26
|
+
%w(<%=@name=>).each do |profile|
|
27
|
+
ServerspecTask.new(profile.to_sym) do |t|
|
28
|
+
t.target = profile
|
29
|
+
t.pattern = "spec/#{profile}/*_spec.rb"
|
19
30
|
end
|
31
|
+
end
|
20
32
|
end
|
33
|
+
|
34
|
+
task :default => 'serverspec:minimal'
|
File without changes
|
@@ -6,41 +6,28 @@ include SpecInfra::Helper::Ssh
|
|
6
6
|
include SpecInfra::Helper::DetectOS
|
7
7
|
|
8
8
|
RSpec.configure do |c|
|
9
|
-
if ENV['ASK_SUDO_PASSWORD']
|
10
|
-
require 'highline/import'
|
11
|
-
c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false }
|
12
|
-
else
|
13
|
-
c.sudo_password = ENV['SUDO_PASSWORD']
|
14
|
-
end
|
15
9
|
c.before :all do
|
16
|
-
|
17
|
-
if
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
if
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
host = match[1]
|
34
|
-
elsif match = /User (.*)/.match(line)
|
35
|
-
user = match[1]
|
36
|
-
elsif match = /IdentityFile (.*)/.match(line)
|
37
|
-
options[:keys] = [match[1].gsub(/"/,'')]
|
38
|
-
elsif match = /Port (.*)/.match(line)
|
39
|
-
options[:port] = match[1]
|
40
|
-
end
|
10
|
+
c.host = ENV['TARGET_HOST']
|
11
|
+
c.ssh.close if c.ssh
|
12
|
+
options = Net::SSH::Config.for(c.host)
|
13
|
+
user = 'vagrant'
|
14
|
+
vagrant_up = `vagrant up #{c.host}`
|
15
|
+
config = `vagrant ssh-config #{c.host}`
|
16
|
+
sshhost = sshuser = ''
|
17
|
+
if config != ''
|
18
|
+
config.each_line do |line|
|
19
|
+
if match = /HostName (.*)/.match(line)
|
20
|
+
sshhost = match[1]
|
21
|
+
elsif match = /User (.*)/.match(line)
|
22
|
+
sshuser = match[1]
|
23
|
+
elsif match = /IdentityFile (.*)/.match(line)
|
24
|
+
options[:keys] = [match[1].gsub(/"/,'')]
|
25
|
+
elsif match = /Port (.*)/.match(line)
|
26
|
+
options[:port] = match[1]
|
41
27
|
end
|
42
28
|
end
|
43
|
-
c.ssh = Net::SSH.start(host, user, options)
|
44
29
|
end
|
30
|
+
|
31
|
+
c.ssh = Net::SSH.start(sshhost, sshuser, options)
|
45
32
|
end
|
46
33
|
end
|
data/templates/puppet/Rakefile
CHANGED
@@ -22,3 +22,29 @@ end
|
|
22
22
|
require 'puppet-lint/tasks/puppet-lint'
|
23
23
|
PuppetLint.configuration.ignore_paths =['modules/**/*', 'vendor/**/*']
|
24
24
|
PuppetLint.configuration.send("disable_80chars")
|
25
|
+
|
26
|
+
desc "Run serverspec to all hosts"
|
27
|
+
task :spec => 'serverspec:all'
|
28
|
+
|
29
|
+
class ServerspecTask < RSpec::Core::RakeTask
|
30
|
+
|
31
|
+
attr_accessor :target
|
32
|
+
|
33
|
+
def spec_command
|
34
|
+
cmd = super
|
35
|
+
"env TARGET_HOST=#{target} #{cmd}"
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
namespace :serverspec do
|
41
|
+
|
42
|
+
%w(<%=@name=>).each do |profile|
|
43
|
+
ServerspecTask.new(profile.to_sym) do |t|
|
44
|
+
t.target = profile
|
45
|
+
t.pattern = "spec/#{profile}/*_spec.rb"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
task :default => 'serverspec:minimal'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opskeleton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- narkisr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -164,7 +164,7 @@ files:
|
|
164
164
|
- templates/hiera_vagrant.yaml
|
165
165
|
- templates/module/Rakefile.erb
|
166
166
|
- templates/module/spec_helper.rb
|
167
|
-
- templates/parent/spec/default/
|
167
|
+
- templates/parent/spec/default/stub_spec.rb
|
168
168
|
- templates/parent/spec/spec_helper.rb
|
169
169
|
- templates/parent/travis.erb
|
170
170
|
- templates/puppet/Rakefile
|