Further modernize the cookbook and remove legacy setup

Remove container setup that comes for free with the dokken containers now
Use the new openssl resource names
Remove all the encoding statements that even rubocop doesn't recommend anymore
Remove some compatibility with centos-5 and ubuntu 15.10

Signed-off-by: Tim Smith <tsmith@chef.io>
This commit is contained in:
Tim Smith 2019-02-13 21:50:33 -08:00
parent 8fcef84820
commit 4b3095dac2
19 changed files with 5 additions and 49 deletions

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Stephan Renatus
include_recipe 'runit::default'

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Stephan Renatus
directory '/etc/init' do

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Christoph Hartmann
case node['platform_family']

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Stephan Renatus
case node['platform']

View file

@ -1,9 +1,9 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter
#
# prepare all operating systems with the required configuration
apt_update if platform_family?('debian')
# inject the current inspec gem for use with audit cookbook
# this is generated via Rake test:integration
@ -29,9 +29,6 @@ end
# set a static node uuid for our testing nodes
Chef::Config[:chef_guid] = uuid_from_string(node.name)
# container preparation
include_recipe('os_prepare::prep_container')
# confgure ssh
include_recipe('os_prepare::ssh')

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Christoph Hartmann
if platform_family?('rhel', 'debian', 'fedora')

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter
#

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Stephan Renatus
if platform_family?('rhel', 'debian', 'fedora')

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter
#

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter
#

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Omar Irizarry
#
# change a few Windows registry keys for testing purposes

View file

@ -1,16 +1,6 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter
#
# installs everything to do the package test
case node['platform_family']
when 'debian'
apt_update
package 'curl'
when 'rhel', 'fedora', 'amazon'
package 'curl'
when 'freebsd'
# do nothing
# TODO: implement Freebsd packages
end
package 'curl'

View file

@ -1,18 +1,10 @@
# encoding: utf-8
# author: Stephan Renatus
#
# installs everyting for the postgres tests
# hw-cookbooks/postgresql is tested on these platforms
# sous-chefs/postgresql is tested on these platforms
case node['platform']
when 'ubuntu', 'centos'
# also skip it on ubuntu 15.10, because the cookbook is not supported
# with `enable_pgdg_apt` yet
return if node['platform_version'] == "15.10"
# skip it on centos 5, because ca-certificates is not available
return if node['platform_version'] == "5"
node.default['postgresql']['enable_pgdg_apt'] = true
node.default['postgresql']['config']['listen_addresses'] = 'localhost'
node.default['postgresql']['password']['postgres'] = 'md506be11be01439cb4abd537e454df34ea' # "inspec"

View file

@ -1,9 +0,0 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter
#
# prepares container for normal use :-)
# if package lsb-release & procps is not installed
# chef returns an empty node['lsb']['codename']
package %w(procps lsb-release) if platform_family?('debian')

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Alex Pop
# author: Christoph Hartmann
#

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter
#

View file

@ -1,4 +1,3 @@
# encoding: utf-8
# author: Christoph Hartmann
#
# installs ssh

View file

@ -1,6 +1,6 @@
if node['platform_family'] != 'windows'
openssl_x509 '/tmp/mycert.pem' do
openssl_x509_request '/tmp/mycert.pem' do
common_name 'www.f00bar.com'
org 'Foo Bar'
org_unit 'Lab'
@ -8,7 +8,7 @@ if node['platform_family'] != 'windows'
expire 360
end
openssl_rsa_key '/tmp/server.key' do
openssl_rsa_private_key '/tmp/server.key' do
key_length 2048
end