serverspec 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -160
- data/lib/serverspec/setup.rb +1 -1
- data/lib/serverspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 825860011fe04382ba828513e795755252075183
|
4
|
+
data.tar.gz: 49a22eb4a22d4c394e70d499f9c5decc84e64b54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2617a6cad98b547d6204cc322fef7d9c360dc006a43d84d7a791fed594486ce86d58c198656d6c5284c41835b1880a05be3be711773c2ddc2660cc60f32bd09e
|
7
|
+
data.tar.gz: 38f22e104bbce0d1a0760bb15e4ad4427df8de8d876c8dffd168234bc27fad48f019c955281da42bfe118b5d0ae6c91713a7d6e387c226a445433038f314fe13
|
data/README.md
CHANGED
@@ -6,166 +6,6 @@ You can see the details of serverspec on [serverspec.org](http://serverspec.org/
|
|
6
6
|
|
7
7
|
----
|
8
8
|
|
9
|
-
## Quick Installation
|
10
|
-
|
11
|
-
Add this line to your application's Gemfile:
|
12
|
-
|
13
|
-
gem 'serverspec'
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install serverspec
|
22
|
-
|
23
|
-
----
|
24
|
-
|
25
|
-
## Usage
|
26
|
-
|
27
|
-
```
|
28
|
-
$ serverspec-init
|
29
|
-
Select OS type:
|
30
|
-
|
31
|
-
1) UN*X
|
32
|
-
2) Windows
|
33
|
-
|
34
|
-
Select number: 1
|
35
|
-
|
36
|
-
Select a backend type:
|
37
|
-
|
38
|
-
1) SSH
|
39
|
-
2) Exec (local)
|
40
|
-
|
41
|
-
Select number: 1
|
42
|
-
|
43
|
-
Vagrant instance y/n: n
|
44
|
-
Input target host name: www.example.jp
|
45
|
-
|
46
|
-
+ spec/
|
47
|
-
+ spec/www.example.jp/
|
48
|
-
+ spec/www.example.jp/httpd_spec.rb
|
49
|
-
+ spec/spec_helper.rb
|
50
|
-
+ Rakefile
|
51
|
-
```
|
52
|
-
|
53
|
-
`spec/www.example.jp/httpd_spec.rb` is a sample spec file and its content is like this.
|
54
|
-
|
55
|
-
```ruby
|
56
|
-
require 'spec_helper'
|
57
|
-
|
58
|
-
describe package('httpd') do
|
59
|
-
it { should be_installed }
|
60
|
-
end
|
61
|
-
|
62
|
-
describe service('httpd') do
|
63
|
-
it { should be_enabled }
|
64
|
-
it { should be_running }
|
65
|
-
end
|
66
|
-
|
67
|
-
describe port(80) do
|
68
|
-
it { should be_listening }
|
69
|
-
end
|
70
|
-
|
71
|
-
describe file('/etc/httpd/conf/httpd.conf') do
|
72
|
-
it { should be_file }
|
73
|
-
its(:content) { should match /ServerName www.example.jp/ }
|
74
|
-
end
|
75
|
-
```
|
76
|
-
|
77
|
-
You can write specs for testing servers like this.
|
78
|
-
|
79
|
-
Serverspec with SSH backend logs in to target servers as a user configured in ``~/.ssh/config`` or a current user. If
|
80
|
-
you'd like to change the user, please edit the below line in ``spec/spec_helper.rb``.
|
81
|
-
|
82
|
-
```ruby
|
83
|
-
user = options[:user] || Etc.getlogin
|
84
|
-
```
|
85
|
-
|
86
|
-
Run tests.
|
87
|
-
|
88
|
-
```
|
89
|
-
$ rake spec
|
90
|
-
/usr/bin/ruby -S rspec spec/www.example.jp/httpd_spec.rb
|
91
|
-
......
|
92
|
-
|
93
|
-
Finished in 0.99715 seconds
|
94
|
-
6 examples, 0 failures
|
95
|
-
```
|
96
|
-
|
97
|
-
----
|
98
|
-
## Multi OS support
|
99
|
-
|
100
|
-
Serverspec supports Darwin based OS, Red Hat based OS, Debian based OS, Gentoo, Solaris and Arch.
|
101
|
-
|
102
|
-
Serverspec can detect target host's OS automatically.
|
103
|
-
|
104
|
-
If you'd like to set target host's OS explicitly, you should include `Specinfra::Helper::OSName` in `spec/spec_helper.rb` like this.
|
105
|
-
|
106
|
-
|
107
|
-
```ruby
|
108
|
-
require 'serverspec'
|
109
|
-
require 'pathname'
|
110
|
-
require 'net/ssh'
|
111
|
-
|
112
|
-
include Specinfra::Helper::Ssh
|
113
|
-
include Specinfra::Helper::Debian
|
114
|
-
|
115
|
-
RSpec.configure do |c|
|
116
|
-
# Add SSH before hook in case you use the SSH backend
|
117
|
-
# (not required for the Exec backend)
|
118
|
-
c.before do
|
119
|
-
host = File.basename(Pathname.new(example.metadata[:location]).dirname)
|
120
|
-
if c.host != host
|
121
|
-
c.ssh.close if c.ssh
|
122
|
-
c.host = host
|
123
|
-
options = Net::SSH::Config.for(c.host)
|
124
|
-
user = options[:user] || Etc.getlogin
|
125
|
-
c.ssh = Net::SSH.start(c.host, user, options)
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
```
|
130
|
-
|
131
|
-
You can select from:
|
132
|
-
|
133
|
-
* SpecInfra::Helper::RedHat
|
134
|
-
* SpecInfra::Helper::Debian
|
135
|
-
* SpecInfra::Helper::Fedora
|
136
|
-
* SpecInfra::Helper::Gentoo
|
137
|
-
* SpecInfra::Helper::Solaris
|
138
|
-
* SpecInfra::Helper::Darwin
|
139
|
-
* SpecInfra::Helper::Arch
|
140
|
-
|
141
|
-
## Vagrant support
|
142
|
-
|
143
|
-
Serverspec now has Vagrant support, and can be automatically configured from a Vagrantfile.
|
144
|
-
|
145
|
-
```
|
146
|
-
$ serverspec-init
|
147
|
-
Select a backend type:
|
148
|
-
|
149
|
-
1) SSH
|
150
|
-
2) Exec (local)
|
151
|
-
|
152
|
-
Select number:1
|
153
|
-
|
154
|
-
Vagrant instance y/n: y
|
155
|
-
Auto-configure Vagrant from Vagrantfile? y/n: y
|
156
|
-
0) web
|
157
|
-
1) db
|
158
|
-
Choose a VM from the Vagrantfile: 1
|
159
|
-
+ spec/db/
|
160
|
-
+ spec/db/httpd_spec.rb
|
161
|
-
+ spec/spec_helper.rb
|
162
|
-
+ Rakefile
|
163
|
-
```
|
164
|
-
|
165
|
-
See details on [serverspec.org](http://serverspec.org)
|
166
|
-
|
167
|
-
----
|
168
|
-
|
169
9
|
## Contributing
|
170
10
|
|
171
11
|
1. Fork it
|
data/lib/serverspec/setup.rb
CHANGED
@@ -219,7 +219,7 @@ end
|
|
219
219
|
list_of_vms = []
|
220
220
|
if vagrant_list != ''
|
221
221
|
vagrant_list.each_line do |line|
|
222
|
-
if match = /([\w-]+[\s]+)(created|aborted|not created|poweroff|running|saved)[\s](\(virtualbox\)|\(vmware\))/.match(line)
|
222
|
+
if match = /([\w-]+[\s]+)(created|aborted|not created|poweroff|running|saved)[\s](\(virtualbox\)|\(vmware\)|\(vmware_fusion\))/.match(line)
|
223
223
|
list_of_vms << match[1].strip!
|
224
224
|
end
|
225
225
|
end
|
data/lib/serverspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|