-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
175 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--format documentation |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
language: python | ||
python: | ||
- "2.7" | ||
|
||
# command to install dependencies | ||
before_install: | ||
- sudo apt-get install software-properties-common | ||
- sudo apt-add-repository -y ppa:brightbox/ruby-ng | ||
- sudo apt-get update | ||
- sudo apt-get install ruby2.3 rsync | ||
- sudo gem install serverspec rake | ||
- sudo curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com | ||
- sudo sh bootstrap-salt.sh | ||
|
||
install: | ||
# Copy state, pillar and minion conf | ||
- sudo mkdir -p /srv/salt/states /srv/pillar | ||
- sudo rsync -av . /srv/salt/states/ --exclude .git | ||
- sudo cp .travis/minion /etc/salt/minion | ||
- sudo cp .travis/state_top.sls /srv/salt/states/top.sls | ||
- sudo cp .travis/pillar_top.sls /srv/pillar/top.sls | ||
- sudo cp pillar.example /srv/pillar/pillar.sls | ||
- sudo service salt-minion restart | ||
|
||
# Additional debug help | ||
- sudo cat /var/log/salt/* | ||
|
||
# See what kind of travis box you're on | ||
- sudo salt-call grains.items --local | ||
|
||
# command to run tests | ||
script: | ||
- sudo salt-call state.highstate --local --retcode-passthrough | ||
- sudo rake spec |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
file_client: local | ||
file_roots: | ||
base: | ||
- /srv/salt/states |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
base: | ||
'*': | ||
- pillar # should be limits, but to make copying .travis.yml easier named it pillar |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
base: | ||
'*': | ||
- limits |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
## [0.1.0] - 2017-07-27 | ||
* Initial release |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'rake' | ||
require 'rspec/core/rake_task' | ||
|
||
task :spec => 'spec:all' | ||
task :default => :spec | ||
|
||
namespace :spec do | ||
targets = [] | ||
Dir.glob('./spec/*').each do |dir| | ||
next unless File.directory?(dir) | ||
target = File.basename(dir) | ||
target = "_#{target}" if target == "default" | ||
targets << target | ||
end | ||
|
||
task :all => targets | ||
task :default => :all | ||
|
||
targets.each do |target| | ||
original_target = target == "_default" ? target[1..-1] : target | ||
desc "Run serverspec tests to #{original_target}" | ||
RSpec::Core::RakeTask.new(target.to_sym) do |t| | ||
ENV['TARGET_HOST'] = original_target | ||
t.pattern = "spec/#{original_target}/*_spec.rb" | ||
end | ||
end | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ limits: | |
limit_value: 5 | ||
- limit_type: hard | ||
limit_item: nproc | ||
limit_value: 500 | ||
limit_value: 500 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
require 'spec_helper' | ||
|
||
describe package('login'), :if => os[:family] == 'debian' do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('login'), :if => os[:family] == 'ubuntu' do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('pam'), :if => os[:family] == 'centos' do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('pam'), :if => os[:family] == 'fedora' do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('pam'), :if => os[:family] == 'redhat' do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('pam'), :if => os[:family] == 'amazon' do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('sys-libs/pam'), :if => os[:family] == 'gentoo' do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('login'), :if => os[:family] == 'mint' do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('pam'), :if => os[:family] == 'suse' do | ||
it { should be_installed } | ||
end | ||
|
||
describe file('/etc/security/limits.conf') do | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
it { should be_mode 644 } | ||
its(:content) { should match /^# User limit specification$/ } | ||
its(:content) { should match /^johndoe hard core unlimited$/ } | ||
its(:content) { should match /^johndoe hard nproc 1000$/ } | ||
its(:content) { should match /^janedoe hard locks 300$/ } | ||
its(:content) { should match /^# Group limit specification$/ } | ||
its(:content) { should match /^@employees hard cpu 5$/ } | ||
its(:content) { should match /^@employees hard nproc 500$/ } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require 'serverspec' | ||
|
||
set :backend, :exec | ||
|