-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set permissions more sanely on log dir. Add tests.
Only sets permissions on the redis_logfile directory if the directory has just been created. Otherwise, it will touch the log file with ownership of the redis user. I'm probably a bad person for not doing this in separate commits, but this also adds in a test-kitchen test suite.
- Loading branch information
1 parent
9e52777
commit 10a4372
Showing
21 changed files
with
242 additions
and
43 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 |
---|---|---|
@@ -1 +1,4 @@ | ||
*.swp | ||
.kitchen/ | ||
.bundle | ||
.vagrant |
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,25 @@ | ||
--- | ||
driver: | ||
name: vagrant | ||
|
||
provisioner: | ||
name: ansible_playbook | ||
ansible_verbose: true | ||
ansible_verbosity: 2 | ||
require_ruby_for_busser: false | ||
require_chef_for_busser: true | ||
hosts: all | ||
|
||
platforms: | ||
- name: ubuntu-14.04 | ||
- name: centos-6.7 | ||
driver_config: | ||
box: wittman/centos-6.7-ansible | ||
- name: centos-7.2 | ||
driver_config: | ||
box: wittman/centos-7.2-ansible | ||
|
||
suites: | ||
- name: default | ||
- name: logfile | ||
- name: sentinel |
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,5 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "test-kitchen" | ||
gem "kitchen-ansible" | ||
gem "kitchen-vagrant" |
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,41 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
faraday (0.9.2) | ||
multipart-post (>= 1.2, < 3) | ||
highline (1.7.8) | ||
kitchen-ansible (0.0.36) | ||
librarian-ansible | ||
test-kitchen (~> 1.4) | ||
kitchen-vagrant (0.19.0) | ||
test-kitchen (~> 1.4) | ||
librarian (0.1.2) | ||
highline | ||
thor (~> 0.15) | ||
librarian-ansible (1.0.6) | ||
faraday | ||
librarian (~> 0.1.0) | ||
mixlib-shellout (2.2.5) | ||
multipart-post (2.0.0) | ||
net-scp (1.2.1) | ||
net-ssh (>= 2.6.5) | ||
net-ssh (2.9.2) | ||
safe_yaml (1.0.4) | ||
test-kitchen (1.4.2) | ||
mixlib-shellout (>= 1.2, < 3.0) | ||
net-scp (~> 1.1) | ||
net-ssh (~> 2.7, < 2.10) | ||
safe_yaml (~> 1.0) | ||
thor (~> 0.18) | ||
thor (0.19.1) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
kitchen-ansible | ||
kitchen-vagrant | ||
test-kitchen | ||
|
||
BUNDLED WITH | ||
1.11.2 |
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
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
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,4 @@ | ||
--- | ||
- hosts: localhost | ||
roles: | ||
- ansible-redis |
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,29 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Redis' do | ||
describe service('redis_6379') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
|
||
describe port(6379) do | ||
it { should be_listening.on('0.0.0.0').with('tcp') } | ||
end | ||
|
||
describe file('/etc/redis/6379.conf') do | ||
it { should be_file } | ||
it { should be_owned_by 'redis' } | ||
its(:content) { should match /port 6379/ } | ||
end | ||
|
||
describe file('/var/run/redis/6379.pid') do | ||
it { should be_file } | ||
it { should be_owned_by 'redis' } | ||
its(:size) { should_be > 0 } | ||
end | ||
|
||
describe file('/proc/sys/vm/overcommit_memory') do | ||
it { should be_file } | ||
it { should contain '1' } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require 'serverspec' | ||
set :backend, :exec |
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,5 @@ | ||
--- | ||
- hosts: localhost | ||
roles: | ||
- role: ansible-redis | ||
redis_logfile: "/var/log/redis.log" |
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,23 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Redis' do | ||
describe service('redis_6379') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
|
||
describe port(6379) do | ||
it { should be_listening.with('tcp') } | ||
end | ||
|
||
describe file('/var/log/redis.log') do | ||
it { should be_file } | ||
it { should be_owned_by 'redis' } | ||
its(:size) { should > 0 } | ||
end | ||
|
||
describe file('/var/log') do | ||
it { should be_directory } | ||
it { should_not be_owned_by('redis') } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require 'serverspec' | ||
set :backend, :exec |
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,6 @@ | ||
--- | ||
- hosts: localhost | ||
roles: | ||
- role: ansible-redis | ||
redis_sentinel: true | ||
redis_sentinel_logfile: "/var/log/redis_sentinel.log" |
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,24 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Redis' do | ||
describe service('sentinel_26379') do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
|
||
describe port(26379) do | ||
it { should be_listening.on('0.0.0.0').with('tcp') } | ||
end | ||
|
||
describe file('/etc/redis/sentinel_26379.conf') do | ||
it { should be_file } | ||
it { should be_owned_by 'redis' } | ||
its(:content) { should match /port 26379/ } | ||
end | ||
|
||
describe file('/var/run/redis/sentinel_26379.pid') do | ||
it { should be_file } | ||
it { should be_owned_by 'redis' } | ||
its(:size) { should > 0 } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require 'serverspec' | ||
set :backend, :exec |
File renamed without changes.
File renamed without changes.