Commit e224db6b authored by Lance Albertson's avatar Lance Albertson
Browse files

Chef 17 updates



- Chef 17 updates: enable `unified_mode` on all resources
- Bump required Chef Infra Client to >= 15.3
- Remove support and testing for RHEL 6 and Ubuntu 16.04
- [CI] Update ActionsHub actions to point at main
- [CI] Update GitHub Actions checkout to v2
Signed-off-by: default avatarLance Albertson <lance@osuosl.org>
parent 19a73755
......@@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@v2
- name: Run Chef Delivery
uses: actionshub/chef-delivery@master
uses: actionshub/chef-delivery@main
env:
CHEF_LICENSE: accept-no-persist
......@@ -22,17 +22,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@v2
- name: Run yaml Lint
uses: actionshub/yamllint@master
uses: actionshub/yamllint@main
mdl:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@v2
- name: Run Markdown Lint
uses: actionshub/markdownlint@master
uses: actionshub/markdownlint@main
dokken:
needs: [mdl, yamllint, delivery]
......@@ -46,7 +46,6 @@ jobs:
- 'centos-7'
- 'centos-8'
- 'fedora-latest'
- 'ubuntu-1604'
- 'ubuntu-1804'
- 'ubuntu-2004'
- 'opensuse-leap-15'
......@@ -60,11 +59,11 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@v2
- name: Install Chef
uses: actionshub/chef-install@master
uses: actionshub/chef-install@main
- name: Dokken
uses: actionshub/kitchen-dokken@master
uses: actionshub/kitchen-dokken@main
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
......@@ -83,4 +82,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@v2
......@@ -4,8 +4,16 @@ This file is used to list changes made in each version of the rsyslog cookbook.
## Unreleased
- Chef 17 updates: enable `unified_mode` on all resources
- Bump required Chef Infra Client to >= 15.3
- Remove support and testing for RHEL 6 and Ubuntu 16.04
- [CI] Update ActionsHub actions to point at main
- [CI] Update GitHub Actions checkout to v2
## 8.0.3 - *2021-06-01*
- Standardise files with files in sous-chefs/repo-management
## 8.0.2 - *2021-04-14*
- Add check for FreeBSD to prevent trying to install a RELP package
......
......@@ -24,7 +24,7 @@ This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of
### Chef
- Chef 13+
- Chef 15.3+
### Other
......
......@@ -145,14 +145,8 @@ when 'rhel', 'fedora', 'amazon'
'uucp,news.crit' => "#{node['rsyslog']['default_log_dir']}/spooler",
'local7.*' => "#{node['rsyslog']['default_log_dir']}/boot.log",
}
# journald is used in systemd
if node['init_package'] == 'systemd'
default['rsyslog']['modules'] = %w(imuxsock imjournal)
default['rsyslog']['additional_directives'] = { 'OmitLocalLogging' => 'on', 'IMJournalStateFile' => 'imjournal.state' }
else
# RainerScript is not well supported by default on older RHEL
default['rsyslog']['config_style'] = 'legacy'
end
default['rsyslog']['modules'] = %w(imuxsock imjournal)
default['rsyslog']['additional_directives'] = { 'OmitLocalLogging' => 'on', 'IMJournalStateFile' => 'imjournal.state' }
else
# format { facility => destination }
default['rsyslog']['default_facility_logs'] = {
......
......@@ -58,13 +58,6 @@ platforms:
image: dokken/fedora-latest
pid_one_command: /usr/lib/systemd/systemd
- name: ubuntu-16.04
driver:
image: dokken/ubuntu-16.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- name: ubuntu-18.04
driver:
image: dokken/ubuntu-18.04
......
......@@ -18,7 +18,6 @@ platforms:
- name: debian-10
- name: fedora-latest
- name: opensuse-leap-15
- name: ubuntu-16.04
- name: ubuntu-18.04
- name: ubuntu-20.04
......
......@@ -6,7 +6,7 @@ description 'Installs and configures rsyslog'
version '8.0.3'
source_url 'https://github.com/sous-chefs/rsyslog'
issues_url 'https://github.com/sous-chefs/rsyslog/issues'
chef_version '>= 13'
chef_version '>= 15.3'
supports 'amazon'
supports 'centos'
......
......@@ -23,6 +23,8 @@ property :input_parameters, Hash, default: {}
property :cookbook_source, String, default: 'rsyslog'
property :template_source, String, default: lazy { labeled_template('file-input.conf.erb', node['rsyslog']['config_style']) }
unified_mode true
action :create do
vars = {
file_name: new_resource.file,
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'rsyslog::client' do
cached(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node|
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '20.04') do |node|
node.normal['rsyslog']['server_ip'] = server_ip
node.normal['rsyslog']['custom_remote'] = custom_remote
end.converge(described_recipe)
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'rsyslog::default' do
cached(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe)
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '20.04').converge(described_recipe)
end
let(:service_resource) { 'service[rsyslog]' }
......@@ -13,7 +13,7 @@ describe 'rsyslog::default' do
context "when node['rsyslog']['relp'] is true" do
cached(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node|
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '20.04') do |node|
node.normal['rsyslog']['use_relp'] = true
end.converge(described_recipe)
end
......@@ -26,7 +26,7 @@ describe 'rsyslog::default' do
context "when node['rsyslog']['enable_tls'] is true" do
context "when node['rsyslog']['tls_ca_file'] is not set" do
cached(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node|
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '20.04') do |node|
node.normal['rsyslog']['enable_tls'] = true
end.converge(described_recipe)
end
......@@ -38,7 +38,7 @@ describe 'rsyslog::default' do
context "when node['rsyslog']['tls_ca_file'] is set" do
cached(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node|
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '20.04') do |node|
node.normal['rsyslog']['enable_tls'] = true
node.normal['rsyslog']['tls_ca_file'] = '/etc/path/to/ssl-ca.crt'
end.converge(described_recipe)
......@@ -50,7 +50,7 @@ describe 'rsyslog::default' do
context "when protocol is not 'tcp'" do
cached(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node|
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '20.04') do |node|
node.normal['rsyslog']['enable_tls'] = true
node.normal['rsyslog']['tls_ca_file'] = '/etc/path/to/ssl-ca.crt'
node.normal['rsyslog']['protocol'] = 'udp'
......@@ -233,7 +233,7 @@ describe 'rsyslog::default' do
context 'COOK-3608 maillog regression test' do
cached(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'centos', version: '6').converge(described_recipe)
ChefSpec::ServerRunner.new(platform: 'centos', version: '8').converge(described_recipe)
end
it 'outputs mail.* to /var/log/maillog' do
......@@ -260,9 +260,9 @@ describe 'rsyslog::default' do
end
context 'when template[/etc/rsyslog.d/35-imfile.conf] receives :create' do
context 'when on centos 6' do
context 'when on centos 8' do
let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'centos', version: '6') do |node|
ChefSpec::ServerRunner.new(platform: 'centos', version: '8') do |node|
node.normal['rsyslog']['imfile']['PollingInterval'] = 10
end.converge(described_recipe)
end
......@@ -272,15 +272,12 @@ describe 'rsyslog::default' do
template.run_action(:create)
end
it "node['rsyslog']['config_style'] will be 'legacy' by default" do
expect(chef_run.node['rsyslog']['config_style']).to eq('legacy')
end
context '/etc/rsyslog.d/35-imfile.conf file' do
it 'will be create with legacy style syntax' do
expect(chef_run).to render_file(template.path).with_content('$ModLoad imfile')
it do
expect(chef_run).to_not render_file(template.path).with_content('$ModLoad imfile')
end
it 'will NOT include module parameter PollingInterval' do
expect(chef_run).not_to render_file(template.path).with_content('PollingInterval')
it do
expect(chef_run).to render_file(template.path).with_content('PollingInterval')
end
it 'is owned by root:root' do
expect(template.owner).to eq('root')
......@@ -296,9 +293,9 @@ describe 'rsyslog::default' do
end
end
end
context 'when on ubuntu 16.04 ' do
context 'when on ubuntu 20.04 ' do
let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node|
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '20.04') do |node|
node.normal['rsyslog']['imfile']['PollingInterval'] = 10
end.converge(described_recipe)
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'rsyslog::server' do
let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node|
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '20.04') do |node|
node.default['rsyslog']['server'] = false
end.converge(described_recipe)
end
......@@ -84,7 +84,7 @@ describe 'rsyslog::server' do
context '/etc/rsyslog.d/49-remote.conf file' do
cached(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe)
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '20.04').converge(described_recipe)
end
before do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment