diff --git a/README.md b/README.md index e5e9c9d..7c4a993 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,14 @@ Attributes | `node['postfix-dovecot']['vmail']['gid']` | `node['postfix-dovecot']['vmail']['uid']` | Virtual mail system group id. | `node['postfix-dovecot']['vmail']['home']` | `'/var/vmail'` | Virtual mail user home path. +## Postfixadmin Attributes + +You can use `node['postfix-dovecot']['postfixadmin']['enabled']` to disable the installation of Postfixadmin. + +| Attribute | Default | Description | +|:---------------------------------------------|:---------------|:----------------------------------| +| `node['postfix-dovecot']['postfixadmin']['enabled']` | `true` | Whether to enable [Postfixadmin](https://github.com/zuazo/postfixadmin-cookbook). + ## Amazon SES Attributes You can use `node['postfix-dovecot']['ses']['enabled']` to enable SES for sending emails. diff --git a/attributes/postfixadmin.rb b/attributes/postfixadmin.rb new file mode 100644 index 0000000..29c0948 --- /dev/null +++ b/attributes/postfixadmin.rb @@ -0,0 +1,22 @@ +# encoding: UTF-8 +# +# Cookbook Name:: postfix-dovecot +# Attributes:: postfixadmin +# Author:: Xabier de Zuazo () +# Copyright:: Copyright (c) 2013 Onddo Labs, SL. +# License:: Apache License, Version 2.0 +# +# 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. +# + +default['postfix-dovecot']['postfixadmin']['enabled'] = true diff --git a/metadata.rb b/metadata.rb index 8d0f005..6223578 100644 --- a/metadata.rb +++ b/metadata.rb @@ -250,3 +250,11 @@ type: 'hash', required: 'optional', calculated: true + +attribute 'postfix-dovecot/postfixadmin/enabled', + display_name: 'postfixadmin enabled', + description: 'Whether to enable Postfixadmin.', + type: 'string', + choice: %w(true false), + required: 'recommended', + default: 'true' diff --git a/recipes/postfixadmin.rb b/recipes/postfixadmin.rb index 3f44c20..cb52203 100644 --- a/recipes/postfixadmin.rb +++ b/recipes/postfixadmin.rb @@ -19,12 +19,14 @@ # limitations under the License. # -node.default['postfixadmin']['server_name'] = - node['postfix-dovecot']['hostname'] -node.default['postfixadmin']['common_name'] = - node['postfix-dovecot']['hostname'] -node.default['postfixadmin']['database']['type'] = - node['postfix-dovecot']['database']['type'] +if node['postfix-dovecot']['postfixadmin']['enabled'] + node.default['postfixadmin']['server_name'] = + node['postfix-dovecot']['hostname'] + node.default['postfixadmin']['common_name'] = + node['postfix-dovecot']['hostname'] + node.default['postfixadmin']['database']['type'] = + node['postfix-dovecot']['database']['type'] -include_recipe 'postfixadmin' -include_recipe 'postfixadmin::map_files' + include_recipe 'postfixadmin' + include_recipe 'postfixadmin::map_files' +end