This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe file('/etc/hosts') do | |
it { should contain "#{attr[:ip]} #{attr[:host_name]}.example.com #{attr[:host_name]}" } | |
end | |
describe file('/etc/hostname') do | |
it { should contain "#{attr[:host_name]}.example.com" } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/ssh' | |
include Serverspec::Helper::Ssh | |
include Serverspec::Helper::DetectOS | |
include Serverspec::Helper::Attributes | |
RSpec.configure do |c| | |
c.path = '/sbin:/usr/sbin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe file('/usr/local/etc/app.conf') do | |
it { should contain "URL=#{attr[:host_name]}.example.com" } | |
end | |
describe port('12345') do | |
it { should be_listening } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package "mysql-server" do | |
action :install | |
end | |
service "mysqld" do | |
action :start | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mariadb] | |
name = MariaDB | |
baseurl = http://yum.mariadb.org/10.0/centos6-x86 | |
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB | |
gpgcheck=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cookbook_file "/etc/yum.repos.d/mariadb.repo" do | |
source "mariadb.repo" | |
mode 00644 | |
owner "root" | |
group "root" | |
end | |
%w{MariaDB-devel MariaDB-client MariaDB-server}.each do |marias| | |
package marias do | |
action :install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/bin/mysqlslap \ | |
--host=localhost \ | |
--port=3306 \ | |
--engine=innodb \ | |
--auto-generate-sql \ | |
--auto-generate-sql-load-type=read \ | |
--auto-generate-sql-add-autoincrement \ | |
--number-char-cols=3 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cookbook_file "/tmp/bench.sh" do | |
source "bench.sh" | |
mode 00755 | |
user root | |
group root | |
end | |
execute "bench_start" do | |
command "/tmp/bench.sh > /tmp/bench_result" | |
only_if {File.exists?("/tmp/bench.sh") && File.exists?("/usr/bin/mysqlslap")} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: test | |
user: ec2-user | |
sudo: yes | |
tasks: | |
- name: install mysql-server | |
action: yum pkg=mysql-server state=installed | |
- name: mysql is running | |
action: service name=mysqld state=running |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe package('mysql-server') do | |
it { should be_installed } | |
end | |
describe service('mysqld') do | |
it { should be_running } | |
end |