feat: implementing kitchen tests and activate them on travis

This commit is contained in:
Eric Veiras Galisson
2019-05-27 16:13:58 +02:00
parent b925a00048
commit 1774df001e
8 changed files with 364 additions and 0 deletions
@@ -0,0 +1,8 @@
control 'Sudo package' do
title 'should be installed'
describe package('sudo') do
it { should be_installed }
end
end
+12
View File
@@ -0,0 +1,12 @@
name: sudoers
title: Sudoers Formula
maintainer: Saltstack-formulas
license: Apache-2.0
summary: Verify that the sudoers formula is setup and configured correctly
supports:
- os-name: debian
- os-name: ubuntu
- os-name: centos
- os-name: fedora
- os-name: opensuse
- os-name: suse
+60
View File
@@ -0,0 +1,60 @@
sudoers:
# By default the main sudoers file is managed by this formula (False to skip)
manage_main_config: True
users:
johndoe:
- 'ALL=(ALL) ALL'
- 'ALL=(root) NOPASSWD: /etc/init.d/httpd'
groups:
sudo:
- 'ALL=(ALL) ALL'
- 'ALL=(nodejs) NOPASSWD: ALL'
netgroups:
sysadmins:
- 'ALL=(ALL) ALL'
defaults:
generic:
- env_reset
- mail_badpass
- secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
user_list:
johndoe: '!requiretty'
ADMINS: '!lecture'
host_list:
www1: 'log_year, logfile=/var/log/sudo.log'
command_list:
PROCESSES: 'noexec'
runas_list:
root: '!set_logname'
aliases:
hosts:
WEBSERVERS:
- www1
- www2
- www3
users:
ADMINS:
- millert
- dowdy
- mikef
commands:
PROCESSES:
- /usr/bin/nice
- /bin/kill
- /usr/bin/renice
- /usr/bin/pkill
- /usr/bin/top
includedir: /etc/sudoers.d
included_files:
/etc/sudoers.d/extra-file:
users:
foo:
- 'ALL=(ALL) ALL'
extra-file-2:
groups:
bargroup:
- 'ALL=(ALL) NOPASSWD: ALL'
extra-file-3:
netgroups:
other_netgroup:
- 'ALL=(ALL) ALL'
+7
View File
@@ -0,0 +1,7 @@
# Pillar needed to run Inspec inside Docker image using sudo to authenticate
# Must be added to pillar of all test suites
sudoers:
users:
kitchen:
- 'ALL=(root) NOPASSWD: ALL'