Skip to content

virt advice is wrong #343

@fayeg21

Description

@fayeg21

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet:
  • Ruby:
  • Distribution:
  • Module version: v3.0.0

How to reproduce (e.g Puppet code you use)

class{'postfix':
    satellite           => false,
    mta                 => true,
    smtp_listen         => 'all',
    mynetworks          => join([lookup('my_network'),' 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128']),
    myorigin            => lookup('my_origin'),
    mydestination       => join([$facts['networking']['hostname'],', localhost.localdomain, localhost']),
    masquerade_domains  => [lookup('masquerade_domains')],
    masquerade_classes  => ['envelope_sender', 'header_sender'],
    root_mail_recipient => lookup('root_email'),
    relayhost           => 'direct',
  }

  postfix::config { 'smtp_generic_maps':
    ensure  => present,
    value   => 'hash:/etc/postfix/generic',
  }

  postfix::hash { '/etc/postfix/generic':
    ensure  => 'present',
    content => epp('profile/email/generic.epp'),
  }

  postfix::hash { '/etc/postfix/virtual':
    ensure => present,
  }

  postfix::config { 'virtual_alias_maps':
    ensure  => present,
    value   => 'hash:/etc/postfix/virtual',
  }

  postfix::virtual {'root@xxxx':
    ensure      => present,
    destination => lookup('root_email'),
  }

What are you seeing

The docs tell you to define a postfix::hash stanza but when you do (and have mta=>true) you get this error:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Postfix::Hash[/etc/postfix/virtual] is already declared at (file: /etc/puppetlabs/code/modules/postfix/manifests/mta.pp, line: 78); cannot redeclare (file: /etc/puppetlabs/code/environments/production/site/profile/manifests/email/smarthost.pp, line: 39)

What behaviour did you expect instead

No erorr when following the docs.

Output log

Any additional information you'd like to impart

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions