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

    helindbe

    09/20/2022, 9:00 PM
    @John Ratliff historically in puppet facts were just top scope variables, later they were all made available under the $facts variable. There is a desire to stop facts from being top scope variables - there are several reasons; i) it takes more processing power to create all the individual variables as opposed to the single $facts ii) the names of custom facts can clash with other top scope things iii) it is bad idea in general to have lots of top scope variables. The big problem with getting rid of them altogether is that the most frequent facts would require more keystrokes, and those are pretty much used everywhere.
  • h

    helindbe

    09/20/2022, 9:02 PM
    Further, IIRC, the mapped path construct can only be used with actual facts and not top scope variables in general. The feature was introduced as it would otherwise be impossible to cut in between facts and any transformation of facts for use in interpolation into hierarchy paths.
  • h

    helindbe

    09/20/2022, 9:03 PM
    Specifically to be able to have a list of paths based on a fact holding an array.
  • s

    Skylar Thompson

    09/20/2022, 9:04 PM
    At least as of Puppet 6, you can at least use node-scope variables with
    mapped_paths
    . Not sure when that was added but we're using it successfully
  • s

    Skylar Thompson

    09/20/2022, 9:04 PM
    I'm not sure about global scope, though
  • j

    John Ratliff

    09/20/2022, 9:05 PM
    It definitely worked with my custom fact.
  • s

    Skylar Thompson

    09/20/2022, 9:05 PM
    Big caveat is that functions don't have access to node-scope variables, which will cause
    mapped_paths
    not to work as expected unless you pass in the node-scope variable to the function.
  • h

    helindbe

    09/20/2022, 9:05 PM
    ok, maybe it changed, or I remembered it wrong
  • h

    helindbe

    09/20/2022, 9:06 PM
    @John Ratliff well, your custom fact would work in any case since it is a fact 🙂
  • h

    helindbe

    09/20/2022, 9:11 PM
    It is worth mentioning that when making stuff in hiera.yaml depend on the values of variables (as opposed to facts), you will always need to use the hiera command line tool with the compilation option. You want to avoid this as much as possible - but understandable if it needs to be done since it is not possible to call functions directly from hiera.yaml (other than using the built in
    mapped_paths
    ). Still, you want to avoid doing this even if it works.
    👍🏼 1
  • s

    sameer

    09/21/2022, 6:02 AM
    message has been deleted
  • s

    sameer

    09/21/2022, 6:18 AM
    apache::vhost { "$xyz03": ensure => 'present', port => 80, docroot => '/var/www', serveradmin => $admin_localhost, servername => $xyz03, notify => [ Service['apache2'], ], directories => [ { path => '/api', auth_name => 'LDAP Auth for API', auth_type => 'Basic', auth_basic_provider => 'ldap', auth_ldap_url => 'ldap://ldap-xyz.software.com/dc=XYZ-DOMAIN?sAMAccountName', require => 'ldap-group CN=V1_DEP_ITServ-AppMgmt,OU=Departments,OU=Groups,OU=Benutzer,DC=XYZ-DOMAIN', }, proxy_pass => [{ 'path' => '/apis/1/', 'url' => 'http://localhost:8091/', }, { 'path' => '/apis/2/', 'url' => 'http://localhost:8092/', }, ], ], } I don't get the proxy pass details(1 and 2) when i run puppet agent but i can see the other details.
  • s

    Slackbot

    09/21/2022, 7:36 AM
    This message was deleted.
    s
    s
    • 3
    • 3
  • s

    Slackbot

    09/21/2022, 9:56 AM
    This message was deleted.
    d
    • 2
    • 1
  • s

    Slackbot

    09/21/2022, 10:49 AM
    This message was deleted.
    g
    k
    • 3
    • 44
  • s

    Slackbot

    09/21/2022, 10:52 AM
    This message was deleted.
    j
    k
    • 3
    • 4
  • g

    Graeme Donaldson

    09/21/2022, 11:46 AM
    Those 3 specific values? Or the pattern "app-<4 digits>"?
  • g

    Graeme Donaldson

    09/21/2022, 12:29 PM
    will it always be 3 of them? or can it be a single one or multiple occurrences, each separated by the pipe?
  • k

    krishna kant mishra

    09/21/2022, 12:33 PM
    It can be single one or multiple occurrence
  • j

    John Ratliff

    09/21/2022, 2:47 PM
    Copy code
    $ puppet lookup -E jdratlif --node <http://test-node.example.com|test-node.example.com> --explain test_fact
    Error: Could not run: Lookup of key 'lookup_options' failed: Lookup using eyaml lookup_key function is only supported when the hiera_eyaml library is present
    Why would I see this error on my puppet server when using
    puppet lookup
    . We are using eyaml, and our puppet runs fine, but I cannot use puppet lookup from CLI here.
  • j

    John Ratliff

    09/21/2022, 2:48 PM
    Copy code
    $ puppet lookup -E jdratlif --node <http://test-node.example.com|test-node.example.com> --explain test_fact
    Error: Could not run: Lookup of key 'lookup_options' failed: Lookup using eyaml lookup_key function is only supported when the hiera_eyaml library is present
    Why would I see this error on my puppet server when using
    puppet lookup
    . We are using eyaml, and our puppet runs fine, but I cannot use puppet lookup from CLI here.
  • j

    John Ratliff

    09/21/2022, 2:48 PM
    CentOS7 and puppet 4.10.12
  • n

    natemccurdy

    09/21/2022, 2:48 PM
    You'll need to install the hiera-eyaml gem into the puppet agent Ruby stack.
  • n

    natemccurdy

    09/21/2022, 2:49 PM
    sudo /opt/puppetlabs/puppet/bin/gem install hiera-eyaml
  • s

    Slackbot

    09/21/2022, 2:49 PM
    This message was deleted.
    h
    • 2
    • 1
  • n

    natemccurdy

    09/21/2022, 2:50 PM
    sudo /opt/puppetlabs/puppet/bin/gem install hiera-eyaml
  • n

    natemccurdy

    09/21/2022, 2:50 PM
    You'll need to install the hiera-eyaml gem into the puppet agent Ruby stack.
  • s

    Slackbot

    09/21/2022, 7:32 PM
    This message was deleted.
    b
    • 2
    • 1
  • s

    simonhoenscheid

    09/21/2022, 7:34 PM
    Hi community, the vscode plugin didnt see a release in about a year. But there are valuable changes. Is there a chance to cut a new release? https://github.com/puppetlabs/puppet-vscode/compare/1.4.0...main
  • s

    sameer

    09/21/2022, 8:00 PM
    message has been deleted
1...169170171...428Latest