From cacb0bb784e015541c4a0e5ee924db0a2384de83 Mon Sep 17 00:00:00 2001 From: Xorima Bot Date: Wed, 27 May 2020 18:30:09 +0000 Subject: [PATCH 01/27] Standardise files with files in chef-cookbooks/repo-management Signed-off-by: Xorima Bot --- .vscode/extensions.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..064bba0 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "chef-software.chef", + "rebornix.ruby", + "editorconfig.editorconfig" + ] +} \ No newline at end of file From 6f0035674687fc6789d9f75b608ba01293090c3b Mon Sep 17 00:00:00 2001 From: Xorima Bot Date: Wed, 10 Jun 2020 11:03:08 +0000 Subject: [PATCH 02/27] Standardise files with files in chef-cookbooks/repo-management Signed-off-by: Xorima Bot --- CODE_OF_CONDUCT.md | 2 +- TESTING.md | 2 +- chefignore | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 980c134..aa60a51 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1 +1 @@ -Please refer to the Chef Community Code of Conduct at https://www.chef.io/code-of-conduct/ +Please refer to the Chef Community Code of Conduct at diff --git a/TESTING.md b/TESTING.md index ca524ab..9596d9b 100644 --- a/TESTING.md +++ b/TESTING.md @@ -1,2 +1,2 @@ Please refer to -https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD + diff --git a/chefignore b/chefignore index 7cc7460..7e24394 100644 --- a/chefignore +++ b/chefignore @@ -10,10 +10,6 @@ Icon? nohup.out Thumbs.db -# SASS # -######## -.sass-cache - # EDITORS # ########### .#* @@ -26,10 +22,11 @@ Thumbs.db *.tmproj *~ \#* -mkmf.log REVISION TAGS* tmtags +.vscode +.editorconfig ## COMPILED ## ############## @@ -42,6 +39,7 @@ tmtags *.so */rdoc/ a.out +mkmf.log # Testing # ########### @@ -95,7 +93,7 @@ Gemfile.lock Policyfile.rb Policyfile.lock.json -# Cookbooks # +# Documentation # ############# CHANGELOG* CONTRIBUTING* From 718e67d41b9b7535c501b22d6a45d591ae8ad861 Mon Sep 17 00:00:00 2001 From: Xorima Bot Date: Mon, 29 Jun 2020 11:03:15 +0000 Subject: [PATCH 03/27] Standardise files with files in chef-cookbooks/repo-management Signed-off-by: Xorima Bot --- chefignore | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/chefignore b/chefignore index 7e24394..cc170ea 100644 --- a/chefignore +++ b/chefignore @@ -9,6 +9,7 @@ ehthumbs.db Icon? nohup.out Thumbs.db +.envrc # EDITORS # ########### @@ -45,17 +46,23 @@ mkmf.log ########### .circleci/* .codeclimate.yml +.delivery/* .foodcritic .kitchen* +.mdlrc +.overcommit.yml .rspec .rubocop.yml .travis.yml .watchr +.yamllint azure-pipelines.yml +Dangerfile examples/* features/* Guardfile kitchen.yml* +mlc_config.json Procfile Rakefile spec/* @@ -68,6 +75,7 @@ test/* .gitconfig .github/* .gitignore +.gitkeep .gitmodules .svn */.bzr/* @@ -95,10 +103,11 @@ Policyfile.lock.json # Documentation # ############# -CHANGELOG* -CONTRIBUTING* -TESTING* CODE_OF_CONDUCT* +CONTRIBUTING* +documentation/* +TESTING* +UPGRADING* # Vagrant # ########### From b204ea814b47ef2caed4322fa609f38e8df6dad6 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 26 Aug 2020 12:03:49 -0700 Subject: [PATCH 04/27] Only use multi-package on *nix Signed-off-by: Tim Smith --- recipes/_common.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/recipes/_common.rb b/recipes/_common.rb index 069495b..6b0bf94 100644 --- a/recipes/_common.rb +++ b/recipes/_common.rb @@ -2,7 +2,7 @@ # Cookbook:: common # Recipe:: default # -# Copyright:: 2009-2019, Chef Software, Inc. +# Copyright:: 2009-2020, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,14 @@ include_recipe 'postfix::_attributes' -package node['postfix']['packages'] +# use multi-package when we can +if node['os'] == 'linux' + package node['postfix']['packages'] +else + node['postfix']['packages'].each do |pkg| + package pkg + end +end package 'procmail' if node['postfix']['use_procmail'] From 3dcbde92e6e2d8c0994b00916ff5dda0b469317b Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 26 Aug 2020 12:05:03 -0700 Subject: [PATCH 05/27] Don't run unit tests in Travis Signed-off-by: Tim Smith --- .travis.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index bd65cf5..0ea448e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,14 +18,12 @@ services: docker env: matrix: - # - INSTANCE=default-amazonlinux # package install times out - INSTANCE=default-centos-6 - INSTANCE=default-centos-7 - INSTANCE=default-debian-9 - INSTANCE=default-debian-10 - INSTANCE=default-ubuntu-1604 - INSTANCE=default-ubuntu-1804 - #- INSTANCE=canonical-amazonlinux - INSTANCE=canonical-centos-6 - INSTANCE=canonical-centos-7 - INSTANCE=canonical-debian-9 @@ -39,11 +37,3 @@ before_script: - chef --version script: KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen verify ${INSTANCE} - -matrix: - include: - - script: - - delivery local all - env: - - UNIT_AND_LINT=1 - - CHEF_LICENSE=accept From 32c3e21c6a3d93f000cd23cf1f8b795cf1173b80 Mon Sep 17 00:00:00 2001 From: Xorima Bot Date: Thu, 3 Sep 2020 11:02:39 +0000 Subject: [PATCH 06/27] Standardise files with files in chef-cookbooks/repo-management Signed-off-by: Xorima Bot --- .github/workflows/branchcleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/branchcleanup.yml b/.github/workflows/branchcleanup.yml index 2aa1e96..f3f61ff 100644 --- a/.github/workflows/branchcleanup.yml +++ b/.github/workflows/branchcleanup.yml @@ -2,7 +2,7 @@ name: Branch Cleanup # This workflow is triggered on all closed pull requests. # However the script does not do anything if a merge was not performed. -on: +"on": pull_request: types: [closed] From 04439af12e5aaeefb4966cc2f26a777bd77a13ba Mon Sep 17 00:00:00 2001 From: Cookstyle Bot Date: Thu, 17 Sep 2020 12:26:32 -0700 Subject: [PATCH 07/27] Cookstyle Bot Auto Corrections with Cookstyle 6.18.8 This change is automatically generated by the Cookstyle Bot using the latest version of Cookstyle (6.18.8). Adopting changes suggested by Cookstyle improves cookbook readability, avoids common coding mistakes, and eases upgrades to newer versions of the Chef Infra Client. ### Style/Encoding - **/recipes/maps.rb:1**: Unnecessary utf-8 encoding comment. - **/test/integration/sasl_auth_multiple/serverspec/sasl_auth_multiple_spec.rb:1**: Unnecessary utf-8 encoding comment. - **/test/integration/sasl_auth_one/serverspec/sasl_auth_one_spec.rb:1**: Unnecessary utf-8 encoding comment. Signed-off-by: Cookstyle --- recipes/maps.rb | 1 - .../sasl_auth_multiple/serverspec/sasl_auth_multiple_spec.rb | 1 - test/integration/sasl_auth_one/serverspec/sasl_auth_one_spec.rb | 1 - 3 files changed, 3 deletions(-) diff --git a/recipes/maps.rb b/recipes/maps.rb index 4c853a5..a1b612f 100644 --- a/recipes/maps.rb +++ b/recipes/maps.rb @@ -1,4 +1,3 @@ -# encoding: utf-8 # Copyright:: 2012-2019, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/integration/sasl_auth_multiple/serverspec/sasl_auth_multiple_spec.rb b/test/integration/sasl_auth_multiple/serverspec/sasl_auth_multiple_spec.rb index 6210b79..c0c4979 100644 --- a/test/integration/sasl_auth_multiple/serverspec/sasl_auth_multiple_spec.rb +++ b/test/integration/sasl_auth_multiple/serverspec/sasl_auth_multiple_spec.rb @@ -1,4 +1,3 @@ -# encoding: utf-8 # Copyright:: 2012-2019, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/integration/sasl_auth_one/serverspec/sasl_auth_one_spec.rb b/test/integration/sasl_auth_one/serverspec/sasl_auth_one_spec.rb index 90b93d2..1e3cb3d 100644 --- a/test/integration/sasl_auth_one/serverspec/sasl_auth_one_spec.rb +++ b/test/integration/sasl_auth_one/serverspec/sasl_auth_one_spec.rb @@ -1,4 +1,3 @@ -# encoding: utf-8 # Copyright:: 2012-2019, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); From da9779700fb932367313de8612f3c329ed64a92e Mon Sep 17 00:00:00 2001 From: Xorima Bot Date: Tue, 6 Oct 2020 17:25:52 +0000 Subject: [PATCH 08/27] Standardise files with files in sous-chefs/repo-management Signed-off-by: Xorima Bot --- .circleci/config.yml | 10 ++++++++ .editorconfig | 10 +------- .envrc | 1 + .github/workflows/md-links.yml | 19 ++++++++++++++ .github/workflows/stale.yml | 28 ++++++++++++++++++++ .gitignore | 16 +++++------- .overcommit.yml | 20 +++++++++++++++ .vscode/extensions.json | 2 +- .yamllint | 6 +++++ CODE_OF_CONDUCT.md | 4 ++- CONTRIBUTING.md | 5 +++- Dangerfile | 47 ++++++++++++++++++++++++++++++++++ TESTING.md | 5 ++-- documentation/.gitkeep | 0 14 files changed, 150 insertions(+), 23 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 .envrc create mode 100644 .github/workflows/md-links.yml create mode 100644 .github/workflows/stale.yml create mode 100644 .overcommit.yml create mode 100644 .yamllint create mode 100644 Dangerfile create mode 100644 documentation/.gitkeep diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..8af810e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,10 @@ +--- +version: 2.1 +orbs: + kitchen: sous-chefs/kitchen@2 +workflows: + danger: + jobs: + - kitchen/danger: + name: danger + context: Danger-Minimal diff --git a/.editorconfig b/.editorconfig index cc21b04..1656a6d 100755 --- a/.editorconfig +++ b/.editorconfig @@ -1,19 +1,11 @@ -# https://EditorConfig.org - +#https://EditorConfig.org # top-most EditorConfig file root=true -# Unix-style newlines with a newline ending every file [*] end_of_line = lf insert_final_newline = true - -# 2 space indentation indent_style = space indent_size = 2 - -# Avoid issues parsing cookbook files later charset = utf-8 - -# Avoid cookstyle warnings trim_trailing_whitespace = true diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..6ed589e --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use chefworkstation diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml new file mode 100644 index 0000000..150e75c --- /dev/null +++ b/.github/workflows/md-links.yml @@ -0,0 +1,19 @@ +--- +name: md-links + +"on": + pull_request: + push: + branches: [master] + +jobs: + md-links: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@master + - name: markdown-link-check + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-verbose-mode: "yes" + folder-path: "documentation" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..0f33701 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,28 @@ +--- +name: Mark stale issues and pull requests + +"on": + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + close-issue-message: > + Closing due to inactivity. + If this is still an issue please reopen or open another issue. + Alternatively drop by the #sous-chefs channel on the [Chef Community Slack](http://community-slack.chef.io/) and we'll be happy to help! + Thanks, Sous-Chefs. + days-before-close: 7 + days-before-stale: 365 + stale-issue-message: > + Marking stale due to inactivity. + Remove stale label or comment or this will be closed in 7 days. + Alternatively drop by the #sous-chefs channel on the [Chef Community Slack](http://community-slack.chef.io/) and we'll be happy to help! + Thanks, Sous-Chefs. diff --git a/.gitignore b/.gitignore index e6099d3..e085291 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,11 @@ *.rbc .config +coverage InstalledFiles lib/bundler/man pkg +rdoc +spec/reports test/tmp test/version_tmp tmp @@ -11,15 +14,12 @@ _Store *# .#* \#*# +.*.sw[a-z] *.un~ *.tmp *.bk *.bkup -# editor temp files -.idea -.*.sw[a-z] - # ruby/bundler files .ruby-version .ruby-gemset @@ -27,16 +27,14 @@ _Store Gemfile.lock .bundle *.gem -coverage -spec/reports -# YARD / rdoc artifacts +# YARD artifacts .yardoc _yardoc doc/ -rdoc +.idea -# chef infra stuff +# chef stuff Berksfile.lock .kitchen kitchen.local.yml diff --git a/.overcommit.yml b/.overcommit.yml new file mode 100644 index 0000000..1d27ed8 --- /dev/null +++ b/.overcommit.yml @@ -0,0 +1,20 @@ +--- +PreCommit: + TrailingWhitespace: + enabled: true + YamlLint: + enabled: true + Rspec: + enabled: true + required_executable: 'rspec' + Cookstyle: + enabled: true + required_executable: 'cookstyle' + command: ["cookstyle"] + Delivery: + enabled: true + required_executable: 'delivery' + flags: ['local', 'all'] +CommitMsg: + HardTabs: + enabled: true diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 064bba0..cd77725 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,4 +4,4 @@ "rebornix.ruby", "editorconfig.editorconfig" ] -} \ No newline at end of file +} diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..ecfdffb --- /dev/null +++ b/.yamllint @@ -0,0 +1,6 @@ +--- +extends: default +rules: + line-length: + max: 256 + level: warning diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index aa60a51..20b4adb 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1 +1,3 @@ -Please refer to the Chef Community Code of Conduct at +# Community Guidelines + +This project follows the Chef Community Guidelines diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd21578..a946aea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1,4 @@ -Please refer to +# Contributing + +Please refer to +[https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 0000000..bc08b7a --- /dev/null +++ b/Dangerfile @@ -0,0 +1,47 @@ +# Reference: http://danger.systems/reference.html + +# A pull request summary is required. Add a description of the pull request purpose. +# Changelog must be updated for each pull request that changes code. +# Warnings will be issued for: +# Pull request with more than 400 lines of code changed +# Pull reqest that change more than 5 lines without test changes +# Failures will be issued for: +# Pull request without summary +# Pull requests with code changes without changelog entry + +def code_changes? + code = %w(libraries attributes recipes resources files templates) + code.each do |location| + return true unless git.modified_files.grep(/#{location}/).empty? + end + false +end + +def test_changes? + tests = %w(spec test kitchen.yml kitchen.dokken.yml) + tests.each do |location| + return true unless git.modified_files.grep(/#{location}/).empty? + end + false +end + +failure 'Please provide a summary of your Pull Request.' if github.pr_body.length < 10 + +warn 'This is a big Pull Request.' if git.lines_of_code > 400 + +warn 'This is a Table Flip.' if git.lines_of_code > 2000 + +# Require a CHANGELOG entry for non-test changes. +if !git.modified_files.include?('CHANGELOG.md') && code_changes? + failure 'Please include a CHANGELOG entry.' +end + +# Require Major Minor Patch version labels +unless github.pr_labels.grep /minor|major|patch/i + warn 'Please add a release label to this pull request' +end + +# A sanity check for tests. +if git.lines_of_code > 5 && code_changes? && !test_changes? + warn 'This Pull Request is probably missing tests.' +end diff --git a/TESTING.md b/TESTING.md index 9596d9b..920e381 100644 --- a/TESTING.md +++ b/TESTING.md @@ -1,2 +1,3 @@ -Please refer to - +# Testing + +Please refer to [the community cookbook documentation on testing](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD). diff --git a/documentation/.gitkeep b/documentation/.gitkeep new file mode 100644 index 0000000..e69de29 From e7e073b340c47ebdf9692df2f205e37117b5b980 Mon Sep 17 00:00:00 2001 From: Xorima Bot Date: Thu, 8 Oct 2020 13:03:29 +0000 Subject: [PATCH 09/27] Standardise files with files in sous-chefs/repo-management Signed-off-by: Xorima Bot --- .editorconfig | 10 +++++++++- .gitignore | 19 ++++++++++--------- .yamllint | 1 + 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.editorconfig b/.editorconfig index 1656a6d..cc21b04 100755 --- a/.editorconfig +++ b/.editorconfig @@ -1,11 +1,19 @@ -#https://EditorConfig.org +# https://EditorConfig.org + # top-most EditorConfig file root=true +# Unix-style newlines with a newline ending every file [*] end_of_line = lf insert_final_newline = true + +# 2 space indentation indent_style = space indent_size = 2 + +# Avoid issues parsing cookbook files later charset = utf-8 + +# Avoid cookstyle warnings trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore index e085291..be3b9a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,7 @@ *.rbc .config -coverage InstalledFiles -lib/bundler/man pkg -rdoc -spec/reports test/tmp test/version_tmp tmp @@ -14,27 +10,32 @@ _Store *# .#* \#*# -.*.sw[a-z] *.un~ *.tmp *.bk *.bkup -# ruby/bundler files +# editor files +.idea +.*.sw[a-z] + +# ruby/bundler/rspec files .ruby-version .ruby-gemset .rvmrc Gemfile.lock .bundle *.gem +coverage +spec/reports -# YARD artifacts +# YARD / rdoc artifacts .yardoc _yardoc doc/ -.idea +rdoc -# chef stuff +# chef infra stuff Berksfile.lock .kitchen kitchen.local.yml diff --git a/.yamllint b/.yamllint index ecfdffb..2d69612 100644 --- a/.yamllint +++ b/.yamllint @@ -4,3 +4,4 @@ rules: line-length: max: 256 level: warning + document-start: disable From 46348016d9301d694039b1d1d47d5ed8a708babc Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 11 Oct 2020 09:19:12 -0700 Subject: [PATCH 10/27] Update Changelog to Sous Chefs Signed-off-by: Lance Albertson --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cab3593..8d6803e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ This file is used to list changes made in each version of the postfix cookbook. +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Unreleased + +### Changed + +- Sous Chefs Adoption + +### Added + +- Standardise files with files in sous-chefs/repo-management + ## 5.3.1 (2018-07-24) - Fixed sbin issue with Chef13 From e937c83d4f7791e78851bd91e9f335b98bc6817d Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Wed, 7 Oct 2020 17:53:18 -0700 Subject: [PATCH 11/27] Cookstyle fixes Signed-off-by: Lance Albertson --- CHANGELOG.md | 4 ++++ recipes/_common.rb | 6 +++--- recipes/client.rb | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d6803e..37af8c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Standardise files with files in sous-chefs/repo-management +### Fixed + +- Cookstyle fixes + ## 5.3.1 (2018-07-24) - Fixed sbin issue with Chef13 diff --git a/recipes/_common.rb b/recipes/_common.rb index 6b0bf94..1361292 100644 --- a/recipes/_common.rb +++ b/recipes/_common.rb @@ -133,7 +133,7 @@ unless node['postfix']['sender_canonical_map_entries'].empty? notifies :reload, 'service[postfix]' end - node.normal['postfix']['main']['sender_canonical_maps'] = "hash:#{node['postfix']['conf_dir']}/sender_canonical" unless node['postfix']['main'].key?('sender_canonical_maps') + node.default['postfix']['main']['sender_canonical_maps'] = "hash:#{node['postfix']['conf_dir']}/sender_canonical" unless node['postfix']['main'].key?('sender_canonical_maps') end execute 'update-postfix-smtp_generic' do @@ -150,7 +150,7 @@ unless node['postfix']['smtp_generic_map_entries'].empty? notifies :reload, 'service[postfix]' end - node.normal['postfix']['main']['smtp_generic_maps'] = "hash:#{node['postfix']['conf_dir']}/smtp_generic" unless node['postfix']['main'].key?('smtp_generic_maps') + node.default['postfix']['main']['smtp_generic_maps'] = "hash:#{node['postfix']['conf_dir']}/smtp_generic" unless node['postfix']['main'].key?('smtp_generic_maps') end execute 'update-postfix-recipient_canonical' do @@ -167,7 +167,7 @@ unless node['postfix']['recipient_canonical_map_entries'].empty? notifies :reload, 'service[postfix]' end - node.normal['postfix']['main']['recipient_canonical_maps'] = "hash:#{node['postfix']['conf_dir']}/recipient_canonical" unless node['postfix']['main'].key?('recipient_canonical_maps') + node.default['postfix']['main']['recipient_canonical_maps'] = "hash:#{node['postfix']['conf_dir']}/recipient_canonical" unless node['postfix']['main'].key?('recipient_canonical_maps') end %w( main master ).each do |cfg| diff --git a/recipes/client.rb b/recipes/client.rb index d58fa20..b5009a6 100644 --- a/recipes/client.rb +++ b/recipes/client.rb @@ -39,6 +39,6 @@ else relayhost = results.map { |n| n['ipaddress'] }.first end -node.normal['postfix']['main']['relayhost'] = "[#{relayhost}]#{relayhost_port}" +node.default['postfix']['main']['relayhost'] = "[#{relayhost}]#{relayhost_port}" include_recipe 'postfix' From be6b6c583791185d70f581ebb8e06ae6cabb5249 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Wed, 7 Oct 2020 17:54:15 -0700 Subject: [PATCH 12/27] ChefSpec fixes Signed-off-by: Lance Albertson --- CHANGELOG.md | 1 + spec/default_spec.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37af8c8..1d1fc6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Cookstyle fixes +- ChefSpec fixes ## 5.3.1 (2018-07-24) diff --git a/spec/default_spec.rb b/spec/default_spec.rb index 887b3a9..e067a53 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -7,7 +7,7 @@ describe 'postfix::default' do context 'on Centos 6' do cached(:chef_run) do - ChefSpec::SoloRunner.new(platform: 'centos', version: 6.9).converge(described_recipe) + ChefSpec::SoloRunner.new(platform: 'centos', version: '6').converge(described_recipe) end it '[COOK-4423] renders file main.cf with /etc/pki/tls/cert.pem' do From 3bf9b4e1d1461aacac79d25b09539a0c91748ec1 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Wed, 7 Oct 2020 18:00:32 -0700 Subject: [PATCH 13/27] Update to use Sous Chefs GH workflow Signed-off-by: Lance Albertson --- .github/workflows/branchcleanup.yml | 17 ------ .github/workflows/ci.yml | 90 +++++++++++++++++++++++++++++ .github/workflows/delivery.yml | 16 ----- .travis.yml | 39 ------------- CHANGELOG.md | 1 + 5 files changed, 91 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/branchcleanup.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/delivery.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/branchcleanup.yml b/.github/workflows/branchcleanup.yml deleted file mode 100644 index f3f61ff..0000000 --- a/.github/workflows/branchcleanup.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Branch Cleanup -# This workflow is triggered on all closed pull requests. -# However the script does not do anything if a merge was not performed. -"on": - pull_request: - types: [closed] - -env: - NO_BRANCH_DELETED_EXIT_CODE: 0 - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: jessfraz/branch-cleanup-action@master diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ba33cfb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,90 @@ +--- +name: ci + +"on": + pull_request: + push: + branches: + - master + +jobs: + delivery: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@master + - name: Run Chef Delivery + uses: actionshub/chef-delivery@master + env: + CHEF_LICENSE: accept-no-persist + + yamllint: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@master + - name: Run yaml Lint + uses: actionshub/yamllint@master + + mdl: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@master + - name: Run Markdown Lint + uses: actionshub/markdownlint@master + + dokken: + needs: [mdl, yamllint, delivery] + runs-on: ubuntu-latest + strategy: + matrix: + os: + - 'amazonlinux' + - 'amazonlinux-2' + - 'debian-9' + - 'debian-10' + - 'centos-6' + - 'centos-7' + - 'centos-8' + - 'fedora-latest' + - 'ubuntu-1604' + - 'ubuntu-1804' + - 'opensuse-leap-15' + suite: + - 'default' + - 'aliases' + - 'client' + - 'server' + - 'canonical' + - 'sasl-auth-none' + - 'sasl-auth-multiple' + - 'sasl-auth-one' + fail-fast: false + + steps: + - name: Check out code + uses: actions/checkout@master + - name: Install Chef + uses: actionshub/chef-install@master + - name: Dokken + uses: actionshub/kitchen-dokken@master + env: + CHEF_LICENSE: accept-no-persist + KITCHEN_LOCAL_YAML: kitchen.dokken.yml + with: + suite: ${{ matrix.suite }} + os: ${{ matrix.os }} + - name: Print debug output on failure + if: failure() + run: | + set -x + sudo journalctl -l --since today + KITCHEN_LOCAL_YAML=kitchen.dokken.yml /usr/bin/kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "journalctl -l" + + final: + needs: [dokken] + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@master diff --git a/.github/workflows/delivery.yml b/.github/workflows/delivery.yml deleted file mode 100644 index 4b5c467..0000000 --- a/.github/workflows/delivery.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: delivery - -on: [push, pull_request] - -jobs: - delivery: - - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@master - - name: Run Chef Delivery - uses: actionshub/chef-delivery@master - env: - CHEF_LICENSE: accept-no-persist \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0ea448e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -addons: - apt: - sources: - - chef-current-xenial - packages: - - chef-workstation - -install: echo "skip bundle install" - -env: - - CHEF_LICENSE=accept - -branches: - only: - - master - -services: docker - -env: - matrix: - - INSTANCE=default-centos-6 - - INSTANCE=default-centos-7 - - INSTANCE=default-debian-9 - - INSTANCE=default-debian-10 - - INSTANCE=default-ubuntu-1604 - - INSTANCE=default-ubuntu-1804 - - INSTANCE=canonical-centos-6 - - INSTANCE=canonical-centos-7 - - INSTANCE=canonical-debian-9 - - INSTANCE=canonical-debian-10 - - INSTANCE=canonical-ubuntu-1604 - - INSTANCE=canonical-ubuntu-1804 - -before_script: - - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER ) - - eval "$(chef shell-init bash)" - - chef --version - -script: KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen verify ${INSTANCE} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d1fc6f..384e3dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Sous Chefs Adoption +- Update to use Sous Chefs GH workflow ### Added From ff96db8fe901faec37631b903eab43e23676768a Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Wed, 7 Oct 2020 18:01:57 -0700 Subject: [PATCH 14/27] Yamllint fixes Signed-off-by: Lance Albertson --- CHANGELOG.md | 1 + kitchen.dokken.yml | 107 ++++++++++++++++++++++---------------------- kitchen.yml | 109 +++++++++++++++++++++++---------------------- 3 files changed, 110 insertions(+), 107 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 384e3dc..fff4f22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Cookstyle fixes - ChefSpec fixes +- Yamllint fixes ## 5.3.1 (2018-07-24) diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 33149ea..a981fe8 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -1,6 +1,7 @@ +--- driver: name: dokken - privileged: true # because Docker and SystemD/Upstart + privileged: true # because Docker and SystemD/Upstart chef_version: <%= ENV['CHEF_VERSION'] || 'current' %> chef_license: accept-no-persist @@ -15,65 +16,65 @@ verifier: name: inspec platforms: -- name: amazonlinux - driver: - image: dokken/amazonlinux - pid_one_command: /sbin/init + - name: amazonlinux + driver: + image: dokken/amazonlinux + pid_one_command: /sbin/init -- name: amazonlinux-2 - driver: - image: dokken/amazonlinux-2 - pid_one_command: /usr/lib/systemd/systemd + - name: amazonlinux-2 + driver: + image: dokken/amazonlinux-2 + pid_one_command: /usr/lib/systemd/systemd -- name: debian-9 - driver: - image: dokken/debian-9 - pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update + - name: debian-9 + driver: + image: dokken/debian-9 + pid_one_command: /bin/systemd + intermediate_instructions: + - RUN /usr/bin/apt-get update -- name: debian-10 - driver: - image: dokken/debian-10 - pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update + - name: debian-10 + driver: + image: dokken/debian-10 + pid_one_command: /bin/systemd + intermediate_instructions: + - RUN /usr/bin/apt-get update -- name: centos-6 - driver: - image: dokken/centos-6 - pid_one_command: /sbin/init + - name: centos-6 + driver: + image: dokken/centos-6 + pid_one_command: /sbin/init -- name: centos-7 - driver: - image: dokken/centos-7 - pid_one_command: /usr/lib/systemd/systemd + - name: centos-7 + driver: + image: dokken/centos-7 + pid_one_command: /usr/lib/systemd/systemd -- name: centos-8 - driver: - image: dokken/centos-8 - pid_one_command: /usr/lib/systemd/systemd + - name: centos-8 + driver: + image: dokken/centos-8 + pid_one_command: /usr/lib/systemd/systemd -- name: fedora-latest - driver: - image: dokken/fedora-latest - pid_one_command: /usr/lib/systemd/systemd + - name: fedora-latest + driver: + 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-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 - pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update + - name: ubuntu-18.04 + driver: + image: dokken/ubuntu-18.04 + pid_one_command: /bin/systemd + intermediate_instructions: + - RUN /usr/bin/apt-get update -- name: opensuse-leap-15 - driver: - image: dokken/opensuse-leap-15 - pid_one_command: /bin/systemd + - name: opensuse-leap-15 + driver: + image: dokken/opensuse-leap-15 + pid_one_command: /bin/systemd diff --git a/kitchen.yml b/kitchen.yml index 61542e9..470e898 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -1,3 +1,4 @@ +--- driver: name: vagrant @@ -29,64 +30,64 @@ platforms: run_list: apt::default suites: -- name: default - run_list: - - recipe[postfix] + - name: default + run_list: + - recipe[postfix] -- name: aliases - run_list: - - recipe[postfix::aliases] + - name: aliases + run_list: + - recipe[postfix::aliases] -- name: client - run_list: - - recipe[postfix::client] + - name: client + run_list: + - recipe[postfix::client] -- name: server - run_list: - - recipe[postfix::server] + - name: server + run_list: + - recipe[postfix::server] -- name: canonical - run_list: - - recipe[postfix] - attributes: - postfix: - recipient_canonical_map_entries: - john: john@doe.com + - name: canonical + run_list: + - recipe[postfix] + attributes: + postfix: + recipient_canonical_map_entries: + john: john@doe.com -- name: sasl_auth_none - run_list: - - recipe[postfix::sasl_auth] - attributes: - postfix: - main: - relayhost: "localhost" - smtp_sasl_auth_enable: "yes" + - name: sasl_auth_none + run_list: + - recipe[postfix::sasl_auth] + attributes: + postfix: + main: + relayhost: "localhost" + smtp_sasl_auth_enable: "yes" -- name: sasl_auth_multiple - run_list: - - recipe[postfix::sasl_auth] - attributes: - postfix: - main: - relayhost: "localhost" - smtp_sasl_auth_enable: "yes" - sasl: - relayhost1: - username: "kitchenuser" - password: "not-a-real-thing" - relayhost2: - username: "anotherkitchenuser" - password: "yet-not-a-real-thing" + - name: sasl_auth_multiple + run_list: + - recipe[postfix::sasl_auth] + attributes: + postfix: + main: + relayhost: "localhost" + smtp_sasl_auth_enable: "yes" + sasl: + relayhost1: + username: "kitchenuser" + password: "not-a-real-thing" + relayhost2: + username: "anotherkitchenuser" + password: "yet-not-a-real-thing" -- name: sasl_auth_one - run_list: - - recipe[postfix::sasl_auth] - attributes: - postfix: - main: - relayhost: "localhost" - smtp_sasl_auth_enable: "yes" - sasl: - relayhost: - username: "kitchenuser" - password: "not-a-real-thing" + - name: sasl_auth_one + run_list: + - recipe[postfix::sasl_auth] + attributes: + postfix: + main: + relayhost: "localhost" + smtp_sasl_auth_enable: "yes" + sasl: + relayhost: + username: "kitchenuser" + password: "not-a-real-thing" From 2cfec38a177d449d901db73946eb454793f0e056 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Wed, 7 Oct 2020 18:02:42 -0700 Subject: [PATCH 15/27] MDL fixes Signed-off-by: Lance Albertson --- .mdlrc | 1 + CHANGELOG.md | 1 + README.md | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .mdlrc diff --git a/.mdlrc b/.mdlrc new file mode 100644 index 0000000..9cc2c63 --- /dev/null +++ b/.mdlrc @@ -0,0 +1 @@ +rules "~MD013", "~MD024", "~MD025" diff --git a/CHANGELOG.md b/CHANGELOG.md index fff4f22..7d6f14e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Cookstyle fixes - ChefSpec fixes - Yamllint fixes +- MDL fixes ## 5.3.1 (2018-07-24) diff --git a/README.md b/README.md index b01c173..fc93ed7 100644 --- a/README.md +++ b/README.md @@ -449,7 +449,6 @@ This cookbook is maintained by Chef's Community Cookbook Engineering team. Our g ## License - **Copyright:** 2009-2017, Chef Software, Inc. ``` From 11eada3c0ce6586bda71e338c641cb3f2b45ba34 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Fri, 9 Oct 2020 17:26:35 -0700 Subject: [PATCH 16/27] Remove EL 6 testing Signed-off-by: Lance Albertson --- .github/workflows/ci.yml | 1 - CHANGELOG.md | 4 ++++ kitchen.dokken.yml | 5 ----- kitchen.yml | 1 - recipes/sasl_auth.rb | 6 +----- spec/default_spec.rb | 4 ++-- 6 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba33cfb..49a4563 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,6 @@ jobs: - 'amazonlinux-2' - 'debian-9' - 'debian-10' - - 'centos-6' - 'centos-7' - 'centos-8' - 'fedora-latest' diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d6f14e..fcddf3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Yamllint fixes - MDL fixes +### Removed + +- Remove EL 6 testing + ## 5.3.1 (2018-07-24) - Fixed sbin issue with Chef13 diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index a981fe8..a4894be 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -40,11 +40,6 @@ platforms: intermediate_instructions: - RUN /usr/bin/apt-get update - - name: centos-6 - driver: - image: dokken/centos-6 - pid_one_command: /sbin/init - - name: centos-7 driver: image: dokken/centos-7 diff --git a/kitchen.yml b/kitchen.yml index 470e898..4e6d48f 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -15,7 +15,6 @@ platforms: driver_config: box: mvbcoding/awslinux - name: amazonlinux-2 - - name: centos-6 - name: centos-7 - name: centos-8 - name: debian-9 diff --git a/recipes/sasl_auth.rb b/recipes/sasl_auth.rb index 21ffa0b..bd9c18f 100644 --- a/recipes/sasl_auth.rb +++ b/recipes/sasl_auth.rb @@ -28,11 +28,7 @@ case node['platform_family'] when 'debian' sasl_pkgs = %w(libsasl2-2 libsasl2-modules ca-certificates) when 'rhel' - sasl_pkgs = if node['platform_version'].to_i < 6 - %w(cyrus-sasl cyrus-sasl-plain openssl) - else - %w(cyrus-sasl cyrus-sasl-plain ca-certificates) - end + sasl_pkgs = %w(cyrus-sasl cyrus-sasl-plain ca-certificates) when 'amazon' sasl_pkgs = %w(cyrus-sasl cyrus-sasl-plain ca-certificates) when 'fedora' diff --git a/spec/default_spec.rb b/spec/default_spec.rb index e067a53..b6f6d50 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -5,9 +5,9 @@ describe 'postfix::default' do stub_command('/usr/bin/test /etc/alternatives/mta -ef /usr/sbin/sendmail.postfix').and_return(true) end - context 'on Centos 6' do + context 'on Centos 8' do cached(:chef_run) do - ChefSpec::SoloRunner.new(platform: 'centos', version: '6').converge(described_recipe) + ChefSpec::SoloRunner.new(platform: 'centos', version: '8').converge(described_recipe) end it '[COOK-4423] renders file main.cf with /etc/pki/tls/cert.pem' do From 9245510efcf9d8e1800996cacbec32da4a6b565e Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 11 Oct 2020 09:13:14 -0700 Subject: [PATCH 17/27] Update README to sous-chefs Signed-off-by: Lance Albertson --- CHANGELOG.md | 1 + README.md | 43 +++++++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcddf3b..55184a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Sous Chefs Adoption - Update to use Sous Chefs GH workflow +- Update README to sous-chefs ### Added diff --git a/README.md b/README.md index fc93ed7..60ade86 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,19 @@ # postfix Cookbook -[![Build Status](https://travis-ci.org/chef-cookbooks/postfix.svg?branch=master)](https://travis-ci.org/chef-cookbooks/postfix) [![Cookbook Version](https://img.shields.io/cookbook/v/postfix.svg)](https://supermarket.chef.io/cookbooks/postfix) +[![Cookbook Version](https://img.shields.io/cookbook/v/apache2.svg)](https://supermarket.chef.io/cookbooks/apache2) +[![CI State](https://github.com/sous-chefs/apache2/workflows/ci/badge.svg)](https://github.com/sous-chefs/apache2/actions?query=workflow%3Aci) +[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors) +[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0) Installs and configures postfix for client or outbound relayhost, or to do SASL authentication. On RHEL-family systems, sendmail will be replaced with postfix. +## Maintainers + +This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit [sous-chefs.org](https://sous-chefs.org/) or come chat with us on the Chef Community Slack in [#sous-chefs](https://chefcommunity.slack.com/messages/C2V7B88SF). + ## Requirements ### Platforms @@ -443,24 +451,27 @@ override_attributes( ) ``` -## Maintainers +## Contributors -This cookbook is maintained by Chef's Community Cookbook Engineering team. Our goal is to improve cookbook quality and to aid the community in contributing to cookbooks. To learn more about our team, process, and design goals see our [team documentation](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/COOKBOOK_TEAM.MD). To learn more about contributing to cookbooks like this see our [contributing documentation](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD), or if you have general questions about this cookbook come chat with us in #cookbok-engineering on the [Chef Community Slack](http://community-slack.chef.io/) +This project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890&button=false) -## License +### Backers -**Copyright:** 2009-2017, Chef Software, Inc. +Thank you to all our backers! -``` -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at +![https://opencollective.com/sous-chefs#backers](https://opencollective.com/sous-chefs/backers.svg?width=600&avatarHeight=40) - http://www.apache.org/licenses/LICENSE-2.0 +### Sponsors -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -``` +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. + +![https://opencollective.com/sous-chefs/sponsor/0/website](https://opencollective.com/sous-chefs/sponsor/0/avatar.svg?avatarHeight=100) +![https://opencollective.com/sous-chefs/sponsor/1/website](https://opencollective.com/sous-chefs/sponsor/1/avatar.svg?avatarHeight=100) +![https://opencollective.com/sous-chefs/sponsor/2/website](https://opencollective.com/sous-chefs/sponsor/2/avatar.svg?avatarHeight=100) +![https://opencollective.com/sous-chefs/sponsor/3/website](https://opencollective.com/sous-chefs/sponsor/3/avatar.svg?avatarHeight=100) +![https://opencollective.com/sous-chefs/sponsor/4/website](https://opencollective.com/sous-chefs/sponsor/4/avatar.svg?avatarHeight=100) +![https://opencollective.com/sous-chefs/sponsor/5/website](https://opencollective.com/sous-chefs/sponsor/5/avatar.svg?avatarHeight=100) +![https://opencollective.com/sous-chefs/sponsor/6/website](https://opencollective.com/sous-chefs/sponsor/6/avatar.svg?avatarHeight=100) +![https://opencollective.com/sous-chefs/sponsor/7/website](https://opencollective.com/sous-chefs/sponsor/7/avatar.svg?avatarHeight=100) +![https://opencollective.com/sous-chefs/sponsor/8/website](https://opencollective.com/sous-chefs/sponsor/8/avatar.svg?avatarHeight=100) +![https://opencollective.com/sous-chefs/sponsor/9/website](https://opencollective.com/sous-chefs/sponsor/9/avatar.svg?avatarHeight=100) From 3dc75789f32ca1990cbe3a5bb07587b2756289fd Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 11 Oct 2020 09:16:04 -0700 Subject: [PATCH 18/27] Update metadata.rb to Sous Chefs Signed-off-by: Lance Albertson --- CHANGELOG.md | 1 + metadata.rb | 32 +++++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55184a1..056699b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Sous Chefs Adoption - Update to use Sous Chefs GH workflow - Update README to sous-chefs +- Update metadata.rb to Sous Chefs ### Added diff --git a/metadata.rb b/metadata.rb index 2295ffe..ab7cda5 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,14 +1,20 @@ -name 'postfix' -maintainer 'Chef Software, Inc.' -maintainer_email 'cookbooks@chef.io' -license 'Apache-2.0' -description 'Installs and configures postfix for client or outbound relayhost, or to do SASL auth' -version '5.3.1' +name 'postfix' +maintainer 'Sous Chefs' +maintainer_email 'help@sous-chefs.org' +license 'Apache-2.0' +description 'Installs and configures postfix for client or outbound relayhost, or to do SASL auth' +version '5.3.1' +source_url 'https://github.com/sous-chefs/postfix' +issues_url 'https://github.com/sous-chefs/postfix/issues' +chef_version '>= 12.15' -%w(ubuntu debian redhat centos amazon oracle scientific smartos fedora freebsd).each do |os| - supports os -end - -source_url 'https://github.com/chef-cookbooks/postfix' -issues_url 'https://github.com/chef-cookbooks/postfix/issues' -chef_version '>= 12.15' +supports 'amazon' +supports 'centos' +supports 'debian' +supports 'fedora' +supports 'freebsd' +supports 'oracle' +supports 'redhat' +supports 'scientific' +supports 'smartos' +supports 'ubuntu' From 0fd6330f75425c1b6bb3c4c67d36b6e8b6efd0df Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 11 Oct 2020 09:52:43 -0700 Subject: [PATCH 19/27] Update test-kitchen to Sous Chefs Signed-off-by: Lance Albertson --- CHANGELOG.md | 1 + kitchen.dokken.yml | 8 ++------ kitchen.yml | 8 +++----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 056699b..9624ce7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update to use Sous Chefs GH workflow - Update README to sous-chefs - Update metadata.rb to Sous Chefs +- Update test-kitchen to Sous Chefs ### Added diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index a4894be..9b84e76 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -1,19 +1,15 @@ --- driver: name: dokken - privileged: true # because Docker and SystemD/Upstart + privileged: true # because Docker and SystemD chef_version: <%= ENV['CHEF_VERSION'] || 'current' %> - chef_license: accept-no-persist + env: [CHEF_LICENSE=accept] transport: name: dokken provisioner: name: dokken - deprecations_as_errors: true - -verifier: - name: inspec platforms: - name: amazonlinux diff --git a/kitchen.yml b/kitchen.yml index 4e6d48f..1b2e705 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -4,8 +4,10 @@ driver: provisioner: name: chef_zero + product_name: chef + enforce_idempotency: true + multiple_converge: 2 deprecations_as_errors: true - chef_license: accept-no-persist verifier: name: inspec @@ -18,15 +20,11 @@ platforms: - name: centos-7 - name: centos-8 - name: debian-9 - run_list: apt::default - name: debian-10 - run_list: apt::default - name: fedora-latest - name: opensuse-leap-15 - name: ubuntu-16.04 - run_list: apt::default - name: ubuntu-18.04 - run_list: apt::default suites: - name: default From 9ab78d05a68b907ba241e5eb2dd76850458d2f1b Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 11 Oct 2020 09:56:40 -0700 Subject: [PATCH 20/27] Remove Amazon Linux 1 testing Signed-off-by: Lance Albertson --- .github/workflows/ci.yml | 1 - CHANGELOG.md | 1 + kitchen.dokken.yml | 5 ----- kitchen.yml | 3 --- 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49a4563..37b457b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,6 @@ jobs: strategy: matrix: os: - - 'amazonlinux' - 'amazonlinux-2' - 'debian-9' - 'debian-10' diff --git a/CHANGELOG.md b/CHANGELOG.md index 9624ce7..fda144d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - Remove EL 6 testing +- Remove Amazon Linux 1 testing ## 5.3.1 (2018-07-24) diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 9b84e76..61409ea 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -12,11 +12,6 @@ provisioner: name: dokken platforms: - - name: amazonlinux - driver: - image: dokken/amazonlinux - pid_one_command: /sbin/init - - name: amazonlinux-2 driver: image: dokken/amazonlinux-2 diff --git a/kitchen.yml b/kitchen.yml index 1b2e705..cf73c86 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -13,9 +13,6 @@ verifier: name: inspec platforms: - - name: amazonlinux - driver_config: - box: mvbcoding/awslinux - name: amazonlinux-2 - name: centos-7 - name: centos-8 From 3727f977971b150965612cc88ca475adf8217f5b Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 11 Oct 2020 09:58:07 -0700 Subject: [PATCH 21/27] Add Ubuntu 20.04 testing Signed-off-by: Lance Albertson --- .github/workflows/ci.yml | 1 + CHANGELOG.md | 1 + kitchen.dokken.yml | 7 +++++++ kitchen.yml | 1 + 4 files changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37b457b..58e0b08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,7 @@ jobs: - 'fedora-latest' - 'ubuntu-1604' - 'ubuntu-1804' + - 'ubuntu-2004' - 'opensuse-leap-15' suite: - 'default' diff --git a/CHANGELOG.md b/CHANGELOG.md index fda144d..5270112 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Standardise files with files in sous-chefs/repo-management +- Add Ubuntu 20.04 testing ### Fixed diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 61409ea..1d3b9e2 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -60,6 +60,13 @@ platforms: intermediate_instructions: - RUN /usr/bin/apt-get update + - name: ubuntu-20.04 + driver: + image: dokken/ubuntu-20.04 + pid_one_command: /bin/systemd + intermediate_instructions: + - RUN /usr/bin/apt-get update + - name: opensuse-leap-15 driver: image: dokken/opensuse-leap-15 diff --git a/kitchen.yml b/kitchen.yml index cf73c86..9e70fff 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -22,6 +22,7 @@ platforms: - name: opensuse-leap-15 - name: ubuntu-16.04 - name: ubuntu-18.04 + - name: ubuntu-20.04 suites: - name: default From 7208c3f559a6a4a17f00c5b3530fa8c69ff3ec46 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 11 Oct 2020 10:44:22 -0700 Subject: [PATCH 22/27] Fix OpenSUSE installation issues OpenSUSE runs a script which builds the main.cf file automatically if a file doesn't exist. This breaks idempotency so go ahead and touch the file via Chef. In addition, postfix is built with incorrect default settings for `setgid_group` and `daemon_directory`, so set it properly in the config. Signed-off-by: Lance Albertson --- CHANGELOG.md | 1 + attributes/default.rb | 3 +++ recipes/_common.rb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5270112..c51c1fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ChefSpec fixes - Yamllint fixes - MDL fixes +- Fix OpenSUSE installation issues ### Removed diff --git a/attributes/default.rb b/attributes/default.rb index 592b09e..d6f7eb8 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -105,6 +105,9 @@ when 'rhel' default['postfix']['cafile'] = '/etc/pki/tls/cert.pem' when 'amazon' default['postfix']['cafile'] = '/etc/pki/tls/cert.pem' +when 'suse' + default['postfix']['main']['setgid_group'] = 'maildrop' + default['postfix']['main']['daemon_directory'] = '/usr/lib/postfix/bin' else default['postfix']['cafile'] = "#{node['postfix']['conf_dir']}/cacert.pem" end diff --git a/recipes/_common.rb b/recipes/_common.rb index 1361292..88d6eee 100644 --- a/recipes/_common.rb +++ b/recipes/_common.rb @@ -42,6 +42,8 @@ when 'rhel', 'fedora', 'amazon' notifies :start, 'service[postfix]' not_if '/usr/bin/test /etc/alternatives/mta -ef /usr/sbin/sendmail.postfix' end +when 'suse' + file '/var/adm/postfix.configured' when 'omnios' manifest_path = ::File.join(Chef::Config[:file_cache_path], 'manifest-postfix.xml') From 24caf18411b0c9c93d3f61d3534ec225a2bfe045 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 11 Oct 2020 14:16:31 -0700 Subject: [PATCH 23/27] Point to correct cookbook Signed-off-by: Lance Albertson --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 60ade86..0be8eb1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # postfix Cookbook -[![Cookbook Version](https://img.shields.io/cookbook/v/apache2.svg)](https://supermarket.chef.io/cookbooks/apache2) -[![CI State](https://github.com/sous-chefs/apache2/workflows/ci/badge.svg)](https://github.com/sous-chefs/apache2/actions?query=workflow%3Aci) +[![Cookbook Version](https://img.shields.io/cookbook/v/postfix.svg)](https://supermarket.chef.io/cookbooks/postfix) +[![CI State](https://github.com/sous-chefs/postfix/workflows/ci/badge.svg)](https://github.com/sous-chefs/postfix/actions?query=workflow%3Aci) [![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors) [![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0) From 7ab1360d4a329b6943f6fa38c9cf79357d2f643b Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 11 Oct 2020 14:35:36 -0700 Subject: [PATCH 24/27] Release 5.4.0 Signed-off-by: Lance Albertson --- CHANGELOG.md | 2 +- metadata.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c51c1fa..03a3b99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ This file is used to list changes made in each version of the postfix cookbook. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 5.4.0 - 2020-10-11 ### Changed diff --git a/metadata.rb b/metadata.rb index ab7cda5..56c9628 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,7 +3,7 @@ maintainer 'Sous Chefs' maintainer_email 'help@sous-chefs.org' license 'Apache-2.0' description 'Installs and configures postfix for client or outbound relayhost, or to do SASL auth' -version '5.3.1' +version '5.4.0' source_url 'https://github.com/sous-chefs/postfix' issues_url 'https://github.com/sous-chefs/postfix/issues' chef_version '>= 12.15' From d93caa21b6a9209efa5532536accc4052cf575b1 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 18 Oct 2020 12:31:17 -0700 Subject: [PATCH 25/27] Ensure all postmap files are rebuilt immediately if needed This fixes a race condition where postmap files are updated but not generated to .db files before postfix has been started or restarted. By running these immediately on updates, this ensures that the .db files exist properly. Signed-off-by: Lance Albertson --- CHANGELOG.md | 4 ++++ recipes/_common.rb | 6 +++--- recipes/access.rb | 2 +- recipes/aliases.rb | 2 +- recipes/relay_restrictions.rb | 2 +- recipes/transports.rb | 2 +- recipes/virtual_aliases.rb | 2 +- recipes/virtual_aliases_domains.rb | 2 +- 8 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03a3b99..11858a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ This file is used to list changes made in each version of the postfix cookbook. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +- Ensure all postmap files are rebuilt immediately if needed + ## 5.4.0 - 2020-10-11 ### Changed diff --git a/recipes/_common.rb b/recipes/_common.rb index 88d6eee..260a9fb 100644 --- a/recipes/_common.rb +++ b/recipes/_common.rb @@ -131,7 +131,7 @@ unless node['postfix']['sender_canonical_map_entries'].empty? owner 'root' group node['root_group'] mode '0644' - notifies :run, 'execute[update-postfix-sender_canonical]' + notifies :run, 'execute[update-postfix-sender_canonical]', :immediately notifies :reload, 'service[postfix]' end @@ -148,7 +148,7 @@ unless node['postfix']['smtp_generic_map_entries'].empty? owner 'root' group node['root_group'] mode '0644' - notifies :run, 'execute[update-postfix-smtp_generic]' + notifies :run, 'execute[update-postfix-smtp_generic]', :immediately notifies :reload, 'service[postfix]' end @@ -165,7 +165,7 @@ unless node['postfix']['recipient_canonical_map_entries'].empty? owner 'root' group node['root_group'] mode '0644' - notifies :run, 'execute[update-postfix-recipient_canonical]' + notifies :run, 'execute[update-postfix-recipient_canonical]', :immediately notifies :reload, 'service[postfix]' end diff --git a/recipes/access.rb b/recipes/access.rb index d774347..cfe5dbd 100644 --- a/recipes/access.rb +++ b/recipes/access.rb @@ -23,5 +23,5 @@ end template node['postfix']['access_db'] do source 'access.erb' - notifies :run, 'execute[update-postfix-access]' + notifies :run, 'execute[update-postfix-access]', :immediately end diff --git a/recipes/aliases.rb b/recipes/aliases.rb index dcdbb4d..f8eec97 100644 --- a/recipes/aliases.rb +++ b/recipes/aliases.rb @@ -25,5 +25,5 @@ end template node['postfix']['aliases_db'] do source 'aliases.erb' - notifies :run, 'execute[update-postfix-aliases]' + notifies :run, 'execute[update-postfix-aliases]', :immediately end diff --git a/recipes/relay_restrictions.rb b/recipes/relay_restrictions.rb index de576e9..08aabcd 100644 --- a/recipes/relay_restrictions.rb +++ b/recipes/relay_restrictions.rb @@ -25,5 +25,5 @@ end template node['postfix']['relay_restrictions_db'] do source 'relay_restrictions.erb' - notifies :run, 'execute[update-postfix-relay-restrictions]' + notifies :run, 'execute[update-postfix-relay-restrictions]', :immediately end diff --git a/recipes/transports.rb b/recipes/transports.rb index 7304712..5436ae6 100644 --- a/recipes/transports.rb +++ b/recipes/transports.rb @@ -25,5 +25,5 @@ end template node['postfix']['transport_db'] do source 'transport.erb' - notifies :run, 'execute[update-postfix-transport]' + notifies :run, 'execute[update-postfix-transport]', :immediately end diff --git a/recipes/virtual_aliases.rb b/recipes/virtual_aliases.rb index 8c79d87..7047807 100644 --- a/recipes/virtual_aliases.rb +++ b/recipes/virtual_aliases.rb @@ -23,6 +23,6 @@ end template node['postfix']['virtual_alias_db'] do source 'virtual_aliases.erb' - notifies :run, 'execute[update-postfix-virtual-alias]' + notifies :run, 'execute[update-postfix-virtual-alias]', :immediately notifies :restart, 'service[postfix]' end diff --git a/recipes/virtual_aliases_domains.rb b/recipes/virtual_aliases_domains.rb index 6c61152..3ded82d 100644 --- a/recipes/virtual_aliases_domains.rb +++ b/recipes/virtual_aliases_domains.rb @@ -23,6 +23,6 @@ end template node['postfix']['virtual_alias_domains_db'] do source 'virtual_aliases_domains.erb' - notifies :run, 'execute[update-postfix-virtual-alias-domains]' + notifies :run, 'execute[update-postfix-virtual-alias-domains]', :immediately notifies :restart, 'service[postfix]' end From 72ad232d0308b368779e69b3b68b9017be823e7c Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Mon, 19 Oct 2020 12:34:12 -0700 Subject: [PATCH 26/27] Enable IPv6 for lo for the canonical suite This is needed to ensure it converges correctly. Signed-off-by: Lance Albertson --- kitchen.yml | 1 + test/fixtures/cookbooks/test/recipes/net_setup.rb | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 test/fixtures/cookbooks/test/recipes/net_setup.rb diff --git a/kitchen.yml b/kitchen.yml index 9e70fff..ebfff31 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -43,6 +43,7 @@ suites: - name: canonical run_list: + - recipe[test::net_setup] - recipe[postfix] attributes: postfix: diff --git a/test/fixtures/cookbooks/test/recipes/net_setup.rb b/test/fixtures/cookbooks/test/recipes/net_setup.rb new file mode 100644 index 0000000..e75459a --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/net_setup.rb @@ -0,0 +1,3 @@ +sysctl 'net.ipv6.conf.lo.disable_ipv6' do + value 0 +end From b4f2fdb4f3ca079cc96203393a262a633772654a Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Tue, 20 Oct 2020 10:22:20 -0700 Subject: [PATCH 27/27] Release 5.4.1 Signed-off-by: Lance Albertson --- CHANGELOG.md | 2 +- metadata.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11858a2..9599a68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ This file is used to list changes made in each version of the postfix cookbook. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 5.4.1 - 2020-10-20 - Ensure all postmap files are rebuilt immediately if needed diff --git a/metadata.rb b/metadata.rb index 56c9628..9b7e829 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,7 +3,7 @@ maintainer 'Sous Chefs' maintainer_email 'help@sous-chefs.org' license 'Apache-2.0' description 'Installs and configures postfix for client or outbound relayhost, or to do SASL auth' -version '5.4.0' +version '5.4.1' source_url 'https://github.com/sous-chefs/postfix' issues_url 'https://github.com/sous-chefs/postfix/issues' chef_version '>= 12.15'