Initial Chef repository
This commit is contained in:
5
site-cookbooks/kosmos-postfix/README.md
Normal file
5
site-cookbooks/kosmos-postfix/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
5apps-postfix Cookbook
|
||||
======================
|
||||
|
||||
This cookbook is a wrapper for the postfix cookbook. It sets up postfix the way
|
||||
we like it.
|
||||
9
site-cookbooks/kosmos-postfix/metadata.rb
Normal file
9
site-cookbooks/kosmos-postfix/metadata.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
name 'kosmos-postfix'
|
||||
maintainer 'Kosmos'
|
||||
maintainer_email 'mail@kosmos.org'
|
||||
license 'All rights reserved'
|
||||
description 'A wrapper cookbook for postfix'
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version '0.1.0'
|
||||
|
||||
depends 'postfix'
|
||||
23
site-cookbooks/kosmos-postfix/recipes/default.rb
Normal file
23
site-cookbooks/kosmos-postfix/recipes/default.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# Cookbook Name:: kosmos-postfix
|
||||
# Recipe:: default
|
||||
#
|
||||
# Copyright 2015, Kosmos
|
||||
#
|
||||
# All rights reserved - Do Not Redistribute
|
||||
#
|
||||
|
||||
smtp_credentials = Chef::EncryptedDataBagItem.load('credentials', 'smtp')
|
||||
|
||||
node.override['postfix']['sasl']['smtp_sasl_user_name'] = smtp_credentials['user_name']
|
||||
node.override['postfix']['sasl']['smtp_sasl_passwd'] = smtp_credentials['password']
|
||||
node.override['postfix']['sasl_password_file'] = "#{node['postfix']['conf_dir']}/sasl_passwd"
|
||||
# Postfix doesn't support smtps relayhost, use STARTSSL instead
|
||||
node.override['postfix']['main']['relayhost'] = smtp_credentials['relayhost']
|
||||
node.override['postfix']['main']['smtp_sasl_auth_enable'] = 'yes'
|
||||
node.override['postfix']['main']['smtp_sasl_password_maps'] = "hash:#{node['postfix']['sasl_password_file']}"
|
||||
node.override['postfix']['main']['smtp_sasl_security_options'] = 'noanonymous'
|
||||
node.override['postfix']['main']['smtp_tls_CAfile'] = '/etc/ssl/certs/ca-certificates.crt'
|
||||
node.override['postfix']['main']['smtpd_tls_CAfile'] = '/etc/ssl/certs/ca-certificates.crt'
|
||||
|
||||
include_recipe 'postfix::default'
|
||||
Reference in New Issue
Block a user