23. 自動テストの例 (Serverspec)
describe service('httpd') do
it { should be_running }
end
# Cehck listen port
describe port(80) do
it { should be_listening.with('tcp') }
end
# Check connect ap servers
describe 'connect ap_servers' do
ap_servers = property[:servers].each_value.select do |server|
server[:roles].include?('ap')
end
ap_servers.each do |server|
describe command("hping3 -S #{server[:private_ip]} -p 8009 -c 5") do
its(:stdout) { should match(/sport=8009 flags=SA/) }
end
end
end
このサーバから別サーバの8009/tcpに接続できるか
Listenしているか
サービスが稼働しているか
26. Terraform
SDNについて、コントロール層で設定をコード化できることが書かれています。
Software Defined Networking
Software Defined Networking (SDN) is becoming increasingly prevalent in the
datacenter, as it provides more control to operators and developers and allows the
network to better support the applications running on top. Most SDN
implementations have a control layer and infrastructure layer.
Terraform can be used to codify the configuration for software defined networks.
This configuration can then be used by Terraform to automatically setup and
modify settings by interfacing with the control layer. This allows configuration to
be versioned and changes to be automated. As an example, AWS VPC is one of the
most commonly used SDN implementations, and can be configured by Terraform.
https://www.terraform.io/intro/use-cases.html