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

    Les Shiner

    01/25/2023, 10:42 PM
    i'll give that a look i just tore everything down and it's all reinstalling right now
  • t

    tragiccode

    01/26/2023, 1:55 AM
    Is it possible to call a puppet function from inside a hiera data yml file ( like common.yml ). The use case would be to “unwrap” a secret
  • t

    tragiccode

    01/26/2023, 1:56 AM
    Is it possible to call a puppet function from inside a hiera data yml file ( like common.yml ). The use case would be to “unwrap” a secret
  • n

    natemccurdy

    01/26/2023, 2:15 AM
    No. From within a Hiera data file, you can only use this small set of "interpolation functions", not arbitrary Puppet functions: https://www.puppet.com/docs/puppet/7/hiera_merging.html#interpolation_functions
  • n

    natemccurdy

    01/26/2023, 2:15 AM
    No. From within a Hiera data file, you can only use this small set of "interpolation functions", not arbitrary Puppet functions: https://www.puppet.com/docs/puppet/7/hiera_merging.html#interpolation_functions
  • n

    natemccurdy

    01/26/2023, 2:20 AM
    Also, the
    Sensitive
    type (which is what would be unwrapped) isn't really a primitive known to Hiera. It's a Puppet type. So a value can't be Sensitive while it's in Hiera. It can be looked up then converted to Sensitive for use in Puppet code, but while it's in Hiera, there's no concept of "Sensitive". https://www.puppet.com/docs/puppet/7/hiera_merging.html#setting_lookup_options_to_refine_the_result_of_a_lookup-make-hiera-return-data-by-casting
  • n

    natemccurdy

    01/26/2023, 2:20 AM
    Also, the
    Sensitive
    type (which is what would be unwrapped) isn't really a primitive known to Hiera. It's a Puppet type. So a value can't be Sensitive while it's in Hiera. It can be looked up then converted to Sensitive for use in Puppet code, but while it's in Hiera, there's no concept of "Sensitive". https://www.puppet.com/docs/puppet/7/hiera_merging.html#setting_lookup_options_to_refine_the_result_of_a_lookup-make-hiera-return-data-by-casting
  • t

    tragiccode

    01/26/2023, 2:36 AM
    Hmm okay
  • s

    Slackbot

    01/26/2023, 3:07 AM
    This message was deleted.
    g
    • 2
    • 1
  • s

    Slackbot

    01/26/2023, 8:07 AM
    This message was deleted.
    b
    t
    j
    • 4
    • 7
  • b

    bastelfreak

    01/26/2023, 8:10 AM
    We recently had some discussions about it in https://github.com/voxpupuli/hiera-eyaml/issues/336 and somewhere else
  • s

    Slackbot

    01/26/2023, 8:23 AM
    This message was deleted.
    ✅ 1
    a
    d
    +2
    • 5
    • 43
  • a

    Anders

    01/26/2023, 8:24 AM
    Hello. Previously it was possible to add a newer version of the facterdb gem in .sync.yaml in a repository managed by PDK to get a newer gem version. However in PDK 2.6.0 facterdb gem is included in Gemfile already and is not replaced but an additional line is added for facterdb causing error because of duplicate definition. Is it possible to replace existing lines in Gemfile? Cannot see anything stated in the documentation about it. Thanks.
  • a

    Anders

    01/26/2023, 9:16 AM
    Tried changing
    gem "facterdb", ~> 1.18',
    to `gem "facterdb", '`~> 1.21', in Gemfile manually but now when running pdk validate or pdk test it fails with:
    Copy code
    NameError: uninitialized constant Concurrent::RubyThreadLocalVar
    Did you mean? Concurrent::RubyThreadPoolExecutor
  • s

    Slackbot

    01/26/2023, 1:51 PM
    This message was deleted.
    b
    c
    +4
    • 7
    • 60
  • s

    Slackbot

    01/26/2023, 3:52 PM
    This message was deleted.
    d
    b
    y
    • 4
    • 24
  • d

    David Sandilands

    01/26/2023, 4:00 PM
    Instead of an if and an empty I would use https://www.puppet.com/docs/puppet/7/function.html#getvar which can have a default value to use if its undefined, for example So <%= getvar($server2['protocol'],'TCP') -%>
  • d

    David Sandilands

    01/26/2023, 4:03 PM
    var / getvar only came in as part of Puppet 6 so it may just reflect how coding was previously done to be fair to example author
  • d

    David Sandilands

    01/26/2023, 4:29 PM
    getvar(server2.protocol,'TCP')
  • d

    David Sandilands

    01/26/2023, 4:29 PM
    Instead of an if and an empty I would use https://www.puppet.com/docs/puppet/7/function.html#getvar which can have a default value to use if its undefined, for example So <%= getvar($server2['protocol'],'TCP') -%> See below note I should have used dot noation So <%= getvar(server2.protocol,'TCP') -%>
  • d

    David Sandilands

    01/26/2023, 4:30 PM
    Instead of an if and an empty I would use https://www.puppet.com/docs/puppet/7/function.html#getvar which can have a default value to use if its undefined, for example So <%= getvar($server2['protocol'],'TCP') -%> See below note I should have used dot notation So <%= getvar(server2.protocol,'TCP') -%>
  • d

    David Sandilands

    01/26/2023, 4:32 PM
    getvar('server2.protocol','TCP')
  • d

    David Sandilands

    01/26/2023, 4:33 PM
    getvar(server2.protocol,'TCP') Sorry should have had quotes getvar('server2.protocol','TCP')
  • d

    David Sandilands

    01/26/2023, 4:33 PM
    Instead of an if and an empty I would use https://www.puppet.com/docs/puppet/7/function.html#getvar which can have a default value to use if its undefined, for example So <%= getvar($server2['protocol'],'TCP') -%> See below note I should have used dot notation So <%= getvar(server2.protocol,'TCP') -%> also was missing quotes So <%= getvar('server2.protocol','TCP') -%>
  • s

    Slackbot

    01/26/2023, 6:17 PM
    This message was deleted.
    n
    b
    h
    • 4
    • 22
  • b

    Brian Schonecker

    01/26/2023, 6:19 PM
    I've looked through a few dozen .epp files but I'm not finding anything that looks like padding or left-justification.
  • b

    Brian Schonecker

    01/26/2023, 6:25 PM
    I'm trying to improve this template by consolidating the duplicate stuff into a loop that detects the size of the "server" hash.
  • b

    Brian Schonecker

    01/26/2023, 6:25 PM
    I'm trying to improve this template by consolidating the duplicate stuff into a loop that detects the size of the "server" hash.
  • b

    Brian Schonecker

    01/26/2023, 6:26 PM
    I'm trying to improve this template by consolidating the duplicate stuff into a loop that detects the size of the "server" hash.
  • b

    Brian Schonecker

    01/26/2023, 6:26 PM
    So my pseudo-code is "if server hash size is greater than one then change the indentation of the (ADDRESS) lines.
1...286287288...428Latest