cookbook 'ssmtp', '~> 0.5.0'
ssmtp (8) Versions 0.5.0 Follow3
Installs/Configures ssmtp
cookbook 'ssmtp', '~> 0.5.0', :supermarket
knife supermarket install ssmtp
knife supermarket download ssmtp
ssmtp Cookbook
This is a Chef cookbook for deploying ssmtp.
Requirements
Platforms:
The following platforms and versions are tested and supported using
test-kitchen.
- Ubuntu 14.04, 16.04
- CentOS 6.9, 7.4
Chef dependencies
yum-epel
Usage
Adding the cookbook
Add ssmtp
as a dependency to your wrapper cookbook.
Configuration
The cookbook provides a couple attributes that help you to configure ssmtp via a role's default_attributes
.
Here's an example role:
name 'mail_server' description "Installs mail related applications." # List of recipes and roles to apply. Requires Chef 0.8, earlier versions use 'recipes()'. run_list( 'recipe[ssmtp]' ) # Attributes applied if the node doesn't have it set already. default_attributes( 'ssmtp' => { 'root' => 'user@example.com', 'rewrite_domain' => 'example.com', 'mailhub_name' => 'smtp.example.com' } ) # Attributes applied no matter what the node has set already. #override_attributes( #)
For a full list of attributes please consult ./attributes/default.rb
.
Authentication
By default this cookbook will use authentication. If you are relying on connecting to your mailhub without providing credentials disable authentication all together by setting auth_enabled
to false.
The cookbook provides an attribute called credential_method
which defines whether authentication credentials are provided in a crypted data bag or via plain text. It defaults to the more secure crypto data bag method.
Available options are:
- data_bag
- plain
Creating the data bag
$ knife data bag create --secret-file .chef/encrypted_data_bag_secret mail ssmtp
Created data_bag[mail]
Created data_bag_item[ssmtp]
$ mkdir -p data_bags/mail
$ knife data bag show mail ssmtp -F json > data_bags/mail/ssmtp.json
Viewing the data bag
$ knife data bag show --secret-file .chef/encrypted_data_bag_secret mail ssmtp
id: ssmtp
password: foobar
username: user@example.com
$ knife data bag show --secret-file .chef/encrypted_data_bag_secret -F json mail ssmtp
{
"username": "user@example.com",
"id": "ssmtp",
"password": "foobar"
}
Development
We have written unit tests using chefspec and integration tests in serverspec executed via test-kitchen. Much of the tooling around this cookbook is exposed via guard and test kitchen, so it is highly recommended to learn more about those tools. The easiest way to get started is to install the Chef Development Kit
Running tests
The following commands will run the tests:
chef exec bundle install
chef exec rubocop
chef exec foodcritic .
chef exec rspec
chef exec kitchen test default-ubuntu-1404
chef exec kitchen test default-centos-70
The above will do ruby style (rubocop) and cookbook style (foodcritic) checks followed by rspec unit tests ensuring proper cookbook operation. Integration tests will be run next on two separate linux platforms (Ubuntu 14.04 LTS Precise 64-bit and CentOS 7.0). Please run the tests on any pull requests that you are about to submit and write tests for defects or new features to ensure backwards compatibility and a stable cookbook that we can all rely upon.
Running tests continuously with guard
This cookbook is also setup to run the checks while you work via the guard gem.
bundle install
bundle exec guard start
Pull requests are very welcome! Make sure your patches are well tested.
License
Copyright © 2009-2015, Sander van Zoest
Copyright © 2012, Mike Adolphs
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
http://www.apache.org/licenses/LICENSE-2.0
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.
Dependent cookbooks
yum-epel >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
ssmtp Cookbook Changelog
This file is used to list changes made in each version of the ssmtp cookbook.
v0.5.0 (2018-02-20)
- [GH-22] Set TLS_CA_File for all platforms by default (@chewi)
- [GH-23] Update hostname to use the fqdn ohai as source (@drenalin23)
- [GH-12] Add Scientific Linux support (@trinitronx)
v0.4.3 (2018-02-19)
- [GH-26] Update ruby versions used for CI, releax yum-epel cookbook version requirement (@mburns)
v0.4.2 (2016-01-27)
- [GH-21] added TLS_CA_File configuration support for RHEL/CentOS (sjourdan)
- update gem dependencies
- fix new rubocop offenses
v0.4.1 (2015-04-21)
- [GH-20] Bump dependency of yum-epel to 0.6.0
- Added source_url and issues_url to metadata
v0.4.0 (2014-10-29)
- [GH-17] Modernize cookbook with latest development tools
- Removed Vagrantfile as it is recommended to use test-kitchen instead
- [GH-16] - Update yum epel dependency to support yum > 3.0
- [GH-15] - Moves config file permissions to attributes
- [GH-14] - Added ssmtp.auth_enabled (default true) and a bit of cleanup
- [GH-13] - Add auth only when
node['ssmtp']['auth_username']
attribute is set.
v0.3.1 (2013-07-08)
- packaging error for 0.3.0
v0.3.0
- [GH-10] - Fixed so non-root users in mail group can send mail (trinitronx)
- [GH-9] - Added support for RHEL family distros (trinitronx)
- [GH-8] - This should fix the test kitchen integration for this cookbook (trinitronx)
- [GH-7] - Update Berksfile :test dependency on cookbook: sysctl (trinitronx)
- [GH-5] - Update test-kitchen dependency in Gemfile (trinitronx)
- [GH-3] - Added use_tls attribute and enabled its use in the ssmtp.conf template (ianneub)
- [GH-2] - Change from using node.domain to node['domain'] incase 'domain' is not available. (ianneub)
v0.2.0
- [GH-1] - Major overhaul (fooforge)
v0.1.0
- Initial Release
Collaborator Number Metric
0.5.0 passed this metric
Contributing File Metric
0.5.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.5.0 passed this metric
No Binaries Metric
0.5.0 passed this metric
Testing File Metric
0.5.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.5.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.5.0 passed this metric
0.5.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.5.0 passed this metric
No Binaries Metric
0.5.0 passed this metric
Testing File Metric
0.5.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.5.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.5.0 passed this metric
0.5.0 passed this metric
Testing File Metric
0.5.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.5.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.5.0 failed this metric
0.5.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number