cookbook 'ssmtp', '= 0.4.0'
ssmtp (8) Versions 0.4.0 Follow3
Installs/Configures ssmtp
cookbook 'ssmtp', '= 0.4.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 12.04, 14.04
- CentOS 6.5, 7.0
Chef dependencies
- No dependencies yet
Usage
Adding the cookbook
Add it to your Librarian-chef Cheffile
:
cookbook 'ssmtp',
:git => 'https://github.com/svanzoest/ssmtp-cookbook.git'
Or clone the cookbook into your local chef repository:
git clone https://github.com/svanzoest/ssmtp-cookbook.git
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
|ruby-1.9.3-p194@hosted-chef| nb-madolphs in ~/Development/Personal/Repositories/hosted-chef
± |master ✓| → knife data bag create --secret-file .chef/encrypted_data_bag_secret mail ssmtp
Created data_bag[mail]
Created data_bag_item[ssmtp]
|ruby-1.9.3-p194@hosted-chef| nb-madolphs in ~/Development/Personal/Repositories/hosted-chef
± |master ✓| → mkdir -p data_bags/mail
|ruby-1.9.3-p194@hosted-chef| nb-madolphs in ~/Development/Personal/Repositories/hosted-chef
± |master ✓| → knife data bag show mail ssmtp -F json > data_bags/mail/ssmtp.json
Viewing the data bag
± |master ✗| → knife data bag show --secret-file .chef/encrypted_data_bag_secret mail ssmtp
id: ssmtp
password: foobar
username: user@example.com
± |master ✗| → knife data bag show --secret-file .chef/encrypted_data_bag_secret -F json mail ssmtp
{
"username": "user@example.com",
"id": "ssmtp",
"password": "foobar"
}
Development
Pull requests are very welcome! Make sure your patches are well tested.
License
Copyright © 2009-2014, 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.5.2 |
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.4.0
- [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
v0.3.2
- [GH-13] - Add auth only when
node['ssmtp']['auth_username']
attribute is set.
v0.3.1
- 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
Foodcritic Metric
0.4.0 passed this metric
0.4.0 passed this metric