Skip to content

Latest commit

 

History

History
477 lines (313 loc) · 10.7 KB

REFERENCE.md

File metadata and controls

477 lines (313 loc) · 10.7 KB

Reference

Table of Contents

Classes

  • 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-pop3d
  • dovecot::service: manage dovecot service

Defined types

  • dovecot::config: Internal define to handle configuration content
  • dovecot::configfile: Internal define to create a configuration file and include it in the main config file

Classes

dovecot

This class installs and cofigures dovecot

Parameters:

Parameters

The following parameters are available in the dovecot class:

main_config

Data type: Hash

Hash of configurations to include in the main configuration file. Defaults to {}

Default value: {}

configs

Data type: Hash

Hash of configs to write Defaults to {}

Default value: {}

main_config_file

Data type: String

the name of the main configuration file

Default value: 'dovecot.conf'

config_path

Data type: String

the path where the configuration is.

Default value: '/etc/dovecot'

local_configdir

Data type: String

the name of a directory to put local configuration files

Default value: 'conf.d'

owner

Data type: String

owner of the configuration files

Default value: 'root'

group

Data type: String

group of the configuration files

Default value: 'root'

mode

Data type: String

mode of the configuration files

Default value: '0644'

include_sysdefault

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

create_resources

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: {}

dovecot::install

This class installs dovecot packages

Will install current versions of dovecot-core,dovecot-imapd and dovecot-pop3d

Parameters

The following parameters are available in the dovecot::install class:

packages

Data type: Array

Array of packages to install Example (hiera): dovecot::install::packages: - dovecot-core - dovecot-imapd - dovecot-pop3d

Default value: ['dovecot-core']

package_ensure

Data type: String

what to ensure for package Defaults to 'installed'

Default value: 'installed'

dovecot::service

manage dovecot service

Parameters

The following parameters are available in the dovecot::service class:

ensure

Data type: String

Whether a service should be running. Defaults to 'running'

Default value: 'running'

enable

Data type: Boolean

Whether a service should be enabled. Defaults to true

Default value: true

service_name

Data type: String

The name of the service

Default value: 'dovecot'

Defined types

dovecot::config

Internal define to handle configuration content

Parameters

The following parameters are available in the dovecot::config defined type:

file

Data type: String

the name (including path) of the configuration file Defaults to $title

Default value: $title

recursion

Data type: String

String to identify the recursion for the sections For details see code ;( Defaults to '0'

Default value: '0'

trim

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

values

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: {}

sections

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: []

dovecot::configfile

Internal define to create a configuration file and include it in the main config file

Parameters

The following parameters are available in the dovecot::configfile defined type:

path

Data type: String

path to the configuration file

owner

Data type: String

owner of the configuration file

group

Data type: String

group of the configuration file

mode

Data type: String

mode of the configuration file

local_configdir

Data type: String

directory name where the local configuration is only used if $include_in is not set to ''

include_in

Data type: Optional[String[1]]

filename to add an include statement for the configuration file. Default unset which disables this function

Default value: undef

filename

Data type: String

the name of the configuration file Defaults to $title

Default value: $title

values

Data type: Hash

Hash of configuration parameters to include in $filename Defaults to {} see previous values example

Default value: {}

sections

Data type: Array[Hash]

Array of configuration section to include in $filenmame Defaults to [] see previous sections example

Default value: []