cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

middleware:iac:serverspec:middleware_spec.html



Serverspec

Serverspec : Middleware Spec Files

apache-httpd_spec.rb

describe package('httpd') do
  it { should be_installed }
end

describe service('htpd') do
  it { should be_enabled } #auto start
  it { should be_running } #
end

describe port(80) do
  it { should be_listening }
end

describe file('/var/log/httpd') do
  it { should be_directory }
end

mariadb_spec.rb

require 'spec_helper'

# install check
describe package('mariadb-server') do
#  it { should be_installed }
  it { should be_installed.with_version '5.5' }
end

# service check
describe service('mariadb') do
  it { should be_enabled }
  it { should be_running }
end

# Listen port check
describe port(3306) do
  it { should be_listening }
end

zabbix-agent_spec.rb

require 'spec_helper'
properties = property['zabbix-agent']

describe package('zabbix-agent') do
  it { should be_installed }
end

describe service('zabbix-agent') do
  it { should be_enabled }
  it { should be_running }
end

describe command('zabbix_agentd -V') do
  it { should return_stdout /#{properties[:version]}/ }
end



middleware/iac/serverspec/middleware_spec.html.txt ยท Last modified: 2017/05/07 by admin

Page Tools