dovecot
: This class installs and cofigures dovecot Parameters:dovecot::install
: This class installs dovecot packages Will install current versions of dovecot-core,dovecot-imapd and dovecot-pop3ddovecot::service
: manage dovecot service
dovecot::config
: Internal define to handle configuration contentdovecot::configfile
: Internal define to create a configuration file and include it in the main config file
This class installs and cofigures dovecot
Parameters:
The following parameters are available in the dovecot
class:
main_config
configs
main_config_file
config_path
local_configdir
owner
group
mode
include_sysdefault
create_resources
Data type: Hash
Hash of configurations to include in the main configuration file. Defaults to {}
Default value: {}
Data type: Hash
Hash of configs to write Defaults to {}
Default value: {}
Data type: String
the name of the main configuration file
Default value: 'dovecot.conf'
Data type: String
the path where the configuration is.
Default value: '/etc/dovecot'
Data type: String
the name of a directory to put local configuration files
Default value: 'conf.d'
Data type: String
owner of the configuration files
Default value: 'root'
Data type: String
group of the configuration files
Default value: 'root'
Data type: String
mode of the configuration files
Default value: '0644'
Data type: Boolean
= true, if true (the default) an include statement in the main configuration file is added to include the system defaults before the local configuration.
Default value: true
Data type: Hash
a Hash of Hashes to create additional resources eg. to retrieve a certificate. Defaults to {} (do not create any additional resources) Example (hiera):
dovecot::create_resources: sslcert::get_cert: get_my_dovecot_cert: private_key_path: '/etc/dovecot/ssl/key.pem' cert_path: '/etc/dovecot/ssl/cert.pem'
Will result in executing:
sslcert::get_cert{'get_my_postfix_cert': private_key_path => "/etc/dovecot/ssl/key.pem" cert_path => "/etc/dovecot/ssl/cert.pem" }
Default value: {}
This class installs dovecot packages
Will install current versions of dovecot-core,dovecot-imapd and dovecot-pop3d
The following parameters are available in the dovecot::install
class:
Data type: Array
Array of packages to install Example (hiera): dovecot::install::packages: - dovecot-core - dovecot-imapd - dovecot-pop3d
Default value: ['dovecot-core']
Data type: String
what to ensure for package Defaults to 'installed'
Default value: 'installed'
manage dovecot service
The following parameters are available in the dovecot::service
class:
Data type: String
Whether a service should be running. Defaults to 'running'
Default value: 'running'
Data type: Boolean
Whether a service should be enabled. Defaults to true
Default value: true
Data type: String
The name of the service
Default value: 'dovecot'
Internal define to handle configuration content
The following parameters are available in the dovecot::config
defined type:
Data type: String
the name (including path) of the configuration file Defaults to $title
Default value: $title
Data type: String
String to identify the recursion for the sections For details see code ;( Defaults to '0'
Default value: '0'
Data type: Integer
integer which gives the amount of spaces used to ident any configuration added in this iteration of the recursion. Defauls to 0
Default value: 0
Data type: Hash
The hash it expects needs name which corresponds to the $filename saved in $config_path/$local_configdir/ For instance the following hash will produce a file in /etc/dovecot/conf.d/master.conf if $config_path and $local_configdir are set to default. NOTE - the file named will be completely overwritten, so ensure that ALL needed values are specified.
dovecot::config:
'master.conf': # <- name ($filename)
values:
default_process_limit: 350
default_vsz_limit: 1024M
default_client_limit: 2000
The resulting /etc/dovecot/conf.d/master.conf will look like this:
This file is managed by Puppet. DO NOT EDIT.
default_client_limit = 2000
default_process_limit = 350
default_vsz_limit = 1024M
Defaults to {}
Default value: {}
Data type: Array[Hash]
Sometimes you need to have Sections in your config files. These are defined as an Array of hashes similar to the intial config hash: Expanding on our previous example, wanting to add a section we can add a 'sections' key to our hash.
dovecot::config:
mail.conf:
values:
'mail_location': 'maildir:~/'
sections:
- name: 'namespace inbox'
values:
'inbox': 'yes'
'seperator': '.'
'prefix': 'INBOX'
This will result in /etc/dovecot/conf.d/mail.conf containing the following:
This file is managed by Puppet. DO NOT EDIT.
mail_location = maildir:~/
namespace inbox {
inbox = yes
separator =.
prefix =INBOX.
}
Some dovecot sections have a double bracket system (section within a section). This is done as follows:
Example (hiera):
dovecot::config:
master.conf:
values:
default_process_limit: 350
default_vsz_limit: 1024M
default_client_limit: 2100
sections:
- name: 'service imap-login'
sections:
- name: 'inet_listener imap'
values:
'port': '143'
- name: inet_listener imaps
values:
'port': '993'
'ssl': 'yes'
- name: 'inet_listener pop3'
values:
'port': '110'
- name: inet_listener pop3s
values:
'port': '995'
'ssl': 'yes'
This will produce the file /etc/dovecot/conf.d/master.conf with content below:
This file is managed by Puppet. DO NOT EDIT.
default_client_limit = 2100
default_process_limit = 350
default_vsz_limit = 1024M
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
}
service pop3-login {
inet_listener pop3 {
port = 110
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
Defaults to []
Default value: []
Internal define to create a configuration file and include it in the main config file
The following parameters are available in the dovecot::configfile
defined type:
Data type: String
path to the configuration file
Data type: String
owner of the configuration file
Data type: String
group of the configuration file
Data type: String
mode of the configuration file
Data type: String
directory name where the local configuration is only used if $include_in is not set to ''
Data type: Optional[String[1]]
filename to add an include statement for the configuration file. Default unset which disables this function
Default value: undef
Data type: String
the name of the configuration file Defaults to $title
Default value: $title
Data type: Hash
Hash of configuration parameters to include in $filename
Defaults to {}
see previous values
example
Default value: {}
Data type: Array[Hash]
Array of configuration section to include in $filenmame
Defaults to []
see previous sections
example
Default value: []