/* == Definition: postfix::transport_regexp_snippet Adds a transport_regexp snippets to /etc/postfix/transport_regexp. See the postfix::transport_regexp class for details. Parameters: - *source* or *content*: source or content of the transport_regexp snippet - *ensure*: present (default) or absent Requires: - Class["postfix"] Example usage: node "toto.example.com" { class { 'postfix': } postfix::transport_regexp { 'wrong_date': content => 'FIXME'; 'bla': source => 'puppet:///files/etc/postfix/transport_regexp.d/bla'; } } */ define postfix::transport_regexp_snippet ( $ensure = "present", $source = '', $content = undef ) { if $source == '' and $content == undef { fail("One of \$source or \$content must be specified for postfix::transport_regexp_snippet ${name}") } if $source != '' and $content != undef { fail("Only one of \$source or \$content must specified for postfix::transport_regexp_snippet ${name}") } include postfix::transport_regexp $fragment = "postfix_transport_regexp_${name}" concat::fragment { "$fragment": ensure => "$ensure", target => '/etc/postfix/transport_regexp', source => $source ? { undef => undef, default => $source, }, content => $content ? { undef => undef, default => $content, }, } }