https://www.puppet.com/community logo
Join Slack
Powered by
# voxpupuli
  • v

    vchepkov

    03/21/2023, 6:48 PM
    so
    postfix::configs
    attribute gets translated into
    puppet::config
    resources
  • m

    matt

    03/21/2023, 6:49 PM
    where are you reading that, I'm looking in config.pp at the moment at the examples in the header and they don't show that
  • v

    vchepkov

    03/21/2023, 6:50 PM
    main class translates it
  • v

    vchepkov

    03/21/2023, 6:50 PM
    init.pp
  • m

    matt

    03/21/2023, 6:50 PM
    found it
  • m

    matt

    03/21/2023, 6:50 PM
    nice, thank you
  • v

    vchepkov

    03/21/2023, 6:50 PM
    https://github.com/voxpupuli/puppet-postfix/blob/master/manifests/init.pp#L326-L330
  • v

    vchepkov

    03/21/2023, 6:50 PM
    https://github.com/voxpupuli/puppet-postfix/blob/master/manifests/init.pp#L326-L330
  • m

    matt

    03/21/2023, 6:50 PM
    slick way to do it, I guess it's due to how big the number of params could be in main.cf
  • m

    matt

    03/21/2023, 6:51 PM
    could end up with endless params to manage
  • v

    vchepkov

    03/21/2023, 6:51 PM
    yep
  • m

    matt

    03/21/2023, 7:08 PM
    I'm missing something, I'm testing the hiera config just for smtpd_tls_cert_file as a test,
  • m

    matt

    03/21/2023, 7:08 PM
    I've got
  • m

    matt

    03/21/2023, 7:08 PM
    postfix::config:
    smtp_use_tls: true
  • m

    matt

    03/21/2023, 7:09 PM
    that should set smtp_use_tls to true in main,cf but it's not, does it need to be formatted different for the loop in init.pp to pick it up,
  • v

    vchepkov

    03/21/2023, 7:15 PM
    change it to
    Copy code
    postfix::configs:
      smtp_use_tls: 'yes'
  • m

    matt

    03/21/2023, 7:17 PM
    configs 's' - the s, the docs say postfix::config have I got that wrong
  • v

    vchepkov

    03/21/2023, 7:17 PM
    nope, you reading the doc wrong 🙂
  • v

    vchepkov

    03/21/2023, 7:19 PM
    postfix::config
    is a resource, it doesn't use hiera postfix class has an attribute -
    configs
    , which it translates to collection of
    postfix::config
    resources
  • v

    vchepkov

    03/21/2023, 7:20 PM
    so you need to pass
    postfix::configs
    in hiera, to be read by postfix class
  • m

    matt

    03/21/2023, 7:21 PM
    ahh, I thought it was setting the hash in postfix::config and then init.pp was looping through that to make postfix.configs
  • m

    matt

    03/21/2023, 7:21 PM
    lets try that again then
  • m

    matt

    03/21/2023, 7:23 PM
    postfix::configs:
  • m

    matt

    03/21/2023, 7:23 PM
    oops
  • m

    matt

    03/21/2023, 7:23 PM
    postfix::configs:
  • m

    matt

    03/21/2023, 7:23 PM
    ok, that's annoying, sorry
  • m

    matt

    03/21/2023, 7:24 PM
    Copy code
    postfix::configs:
     smtp_use_tls: 'yes'
  • v

    vchepkov

    03/21/2023, 7:24 PM
    yep, do that 🙂
  • m

    matt

    03/21/2023, 7:24 PM
    that should work, but the puppet run complains Evaluation Error: Expected value of type Hash, got String
  • m

    matt

    03/21/2023, 7:24 PM
    but how is it a string ? it's a hash
1...376377378...648Latest