voxpupuli / puppet-postfix

Puppet postfix module
Apache License 2.0
72 stars 176 forks source link

Mynetworks value in init.pp is not applied #371

Open pier4r opened 1 year ago

pier4r commented 1 year ago

Affected Puppet, Ruby, OS and module versions/distributions

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

Simply try to use in your manifest

class { 'postfix':
    mynetworks     => '127.0.0.1, 172.18.104.1, 172.17.0.1, 172.18.104.0/24',
}

What are you seeing

The mynetworks value is not set in /etc/postfix/main.cf

What behaviour did you expect instead

That the mynetworks value would be set in /etc/postfix/main.cf

I achieved the result via file_lineas follows:

file_line { 'postfix main.cf mynetworks since augeas in the postfix class does not work':
    ensure => 'present',
    path   => '/etc/postfix/main.cf',
    after  => '#mynetworks = hash:/etc/postfix/network_table',
    line   => "mynetworks = 127.0.0.1, 172.18.104.1, 172.17.0.1, 172.18.104.0/24",
}

Output log

Any additional information you'd like to impart

Maybe mynetworks shouldn't be set via init.pp, but then why is the attribute there? How can I set the networks?

olifre commented 1 year ago

Did you enable either mta or satellite in class { 'postfix': ? One of these must be set to true (both are false by default) for any actual setup to take place.

pier4r commented 7 months ago

No I didn't, thank you (and sorry for the late answer).

In the meantime I found a workaround with configs => { mynetworks => { value => 'networks_here' }} but apparently is the lesser way.