際際滷

際際滷Share a Scribd company logo
serverspecみんなで鹿めて(bДb)???
壊艶姻厩艶姻壊沿艶界みんなで鹿めて(?Д?)???
魃 繍
serverspecみんなで鹿めて(bДb)???
serverspecというgemで[んでみました
¢ できる並
¢ Bgみサ`バをRSpecでテスト
¢ 歌深URL
¢ http://serverspec.org
¢ http://mizzy.org/blog/2013/03/24/3/
serverspecみんなで鹿めて(bДb)???
秘
¢ おもむろに參和をg佩
$ gem install serverspec
$ serverspec-init
☆參和、竃薦は紗垢したもの☆
Select a backend type: 2(local)
Select OS type of target host: 3(Debian)
serverspecみんなで鹿めて(bДb)???
ファイル撹
¢ Rakefile
¢ spec/spec_helper.rb
¢ 俊Aの碧圭(SSHなど)やOS(Debianなど)を筝する
栽はここ
¢ あるいはこのファイルだけ茅して壅init(恬撹gみ
のspecはそのまま)
¢ spec/<ホスト兆>/<なにか兆念>_spec.rb
¢ ntpd_spec.rbやhttpd_spec.rbなど挫みのg了で蛍け
てspecを恬撹
serverspecみんなで鹿めて(bДb)???
specの恬撹
¢ こんな峰を弖
¢ h廠によってうまいことやってくれる
¢ は瘁峰
describe 'httpd' do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end
serverspecみんなで鹿めて(bДb)???
g佩
¢ 參和のコマンドをg佩
¢ Bgみのサ`バのテスト。。
¢ 階age
$ rake spec
/usr/bin/ruby -S rspec spec/localhost/httpd_spec.rb
...
Finished in 0.99715 seconds
3 examples, 0 failures
serverspecみんなで鹿めて(bДb)???
httpd_spec.rbの(1)
¢ should be_installed
¢ 麼Zがインスト`ルgみを豚棋
¢ Debianならdpkg -s <麼Z>
¢ Redhatならrpm -q <麼Z>
¢ よしなにしてくれる
serverspecみんなで鹿めて(bДb)???
httpd_spec.rbの(2)
¢ should be_enabled
¢ 麼Zが嗤(ブ`トrに軟咾垢)並を豚棋
¢ Debianならls /etc/rc3.d/ | grep <麼Z>
¢ Redhatならchkconfig --list <麼Z> | grep 3:on
¢ よしな(ry
serverspecみんなで鹿めて(bДb)???
httpd_spec.rbの(3)
¢ その麿
¢ http://serverspec.org/matchers.html
¢ ファイルがsymlinkかたり
¢ iptablesチェックしたり
¢ ファイルの嶄附たり
¢ 弼?ある
¢ spec_helper.rbについても福待
serverspecみんなで鹿めて(bДb)???
しにspecをいくつかいてみた
¢ 瘁で參和にpushします
¢ https://github.com/sho-h/serverspec-examples.git
$ ls spec/localhost
bootlogd_debian_spec.rb mysql_debian_spec.rb
postgresql_debian_spec.rb
cron_debian_spec.rb ntpd_spec.rb
ssh_debian_spec.rb hosts_spec.rb
p2p_spec.rb users_spec.rb
httpd_spec.rb postgresql_redhat_spec.rb
serverspecみんなで鹿めて(bДb)???
いくつかピックアップ
¢ bootlogd_debian_spec.rb
¢ users_spec.rb
¢ ntpd_spec.rb
¢ p2p_spec.rb
serverspecみんなで鹿めて(bДb)???
bootlogd_debian_spec.rb
¢ /var/log/bootに軟rのログを隠贋する
O協の_J
describe '/etc/default/bootlogd' do
it { should contain "BOOTLOGD_ENABLE=Yes" }
end
serverspecみんなで鹿めて(bДb)???
users_spec.rb
¢ ユ`ザO協の_J
me = ENV["USER"]
describe me do
it { should_not belong_to_group me }
it { should belong_to_group 'adm' }
end
serverspecみんなで鹿めて(bДb)???
ntpd_spec.rb
¢ NTPまわりのO協_J
¢ NTPの揖豚が@Aしている並を_J
describe 'ntp' do
it { should be_installed }
end
...
describe 'ntpq -pn' do
it { should get_stdout /^*d/ }
end
serverspecみんなで鹿めて(bДb)???
p2p_spec.rb
¢ P2PvSのソフトウェアがインスト`ルさ
れていない並を_J
¢ これvSは侮くやるならeのツ`ルがよい
¢ gなチェックをついでにする殻業
describe 'amule' do
it { should_not be_installed }
end
describe 'azureus' do
it { should_not be_installed }
end
serverspecみんなで鹿めて(bДb)???
サンプルは參貧
¢ 階g
¢ コ`ドも富ないので委燐もg
(serverspecも根めて)
serverspecみんなで鹿めて(bДb)???
うれしい並
¢ ヒュ`マンエラ`p
¢ UYにmらないチェックが辛嬬
¢ chef議なツ`ルを聞ってなくても秘辛
¢ プロジェクトgの慌嗤のしやすさ
¢ 聞いまわしやすい
¢ 鹿まるほどうれしい
¢ xぶだけでKわる辛嬬來すらある
serverspecみんなで鹿めて(bДb)???
まだ櫃鬚弔韻覬慴がある並
¢ アップデ`ト指方が謹い
¢ 富し廣吭
¢ みんなで酢らして聞いましょう
serverspecみんなで鹿めて(bДb)???
參貧です
¢ ご賠ありがとうございました
¢ 採かいいアイディアかspecがあればくださ
い

More Related Content

壊艶姻厩艶姻壊沿艶界みんなで鹿めて(?Д?)???