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

    vchepkov

    07/07/2022, 5:04 PM
    Copy code
    [root@gw ~]# grep -c 'Applied' /var/log/messages.1
    48
    [root@gw ~]# grep -c 'puppet/v3' /var/log/messages.1
    23
  • n

    natemccurdy

    07/07/2022, 5:04 PM
    What version of
    puppet-agent
    ?
  • v

    vchepkov

    07/07/2022, 5:05 PM
    6.27.0
  • v

    vchepkov

    07/07/2022, 5:15 PM
    DNS resolver is local
  • v

    vchepkov

    07/07/2022, 5:51 PM
    yeh, sed for slack 🙂
  • v

    vchepkov

    07/07/2022, 6:40 PM
    folks will be very unhappy 🙂 maybe on weekend
  • b

    Brian Schonecker

    07/07/2022, 6:41 PM
    You can set a route to the puppet server with (I'm pseudo-coding here): route add -net puppet.example.com/32 dev eth0
  • b

    Brian Schonecker

    07/07/2022, 7:02 PM
    message has been deleted
  • b

    Brian Schonecker

    07/07/2022, 7:10 PM
    That'd be a VPN connection and a virtual interface. It's OK to try that one, too.
  • s

    Slackbot

    07/07/2022, 7:48 PM
    This message was deleted.
    h
    • 2
    • 3
  • n

    natemccurdy

    07/07/2022, 7:50 PM
    And if
    identifer
    was just
    ["foo", "bar"]
    , it’d expand out to:
    <datadir>/foo/bar.yaml
  • n

    natemccurdy

    07/07/2022, 7:50 PM
    And if
    identifer
    was just
    ["foo", "bar"]
    , it’d expand out to:
    <datadir>/foo/bar.yaml
  • n

    natemccurdy

    07/07/2022, 7:52 PM
    The key here is that the array length is arbitrary. So while
    id/%{identifier.0}/%{identifier.1}.yaml
    , etc… works for statically defined lengths of arrays, it’s not scalable to arbitrary lengths.
  • b

    Brian Schonecker

    07/07/2022, 8:03 PM
    If you're only including foo/bar/baz.yaml then why do you care about the other two unused 'identifier's?
  • b

    Brian Schonecker

    07/07/2022, 8:03 PM
    Could you make another fact that takes identifier and reports the last item in the array?
  • b

    Brian Schonecker

    07/07/2022, 8:04 PM
    What significance do the other [unused?] elements of the array signify?
  • b

    Brian Schonecker

    07/07/2022, 8:07 PM
    Are you attempting something similar to the roles/profiles methodology?
  • n

    natemccurdy

    07/07/2022, 8:10 PM
    Yes, this is essentially role-based data layers. Each role can be broken into segments. And some segments of a role share common data, while others don’t.
  • b

    Brian Schonecker

    07/07/2022, 8:12 PM
    Why the need to have the baz.yaml file two directories deep?
  • n

    natemccurdy

    07/07/2022, 8:13 PM
    Because some other roles than end in
    baz
    might be completely unrelated but just happen to share a last segment name.
  • b

    Brian Schonecker

    07/07/2022, 8:13 PM
    What happens if puppet returns the identifier array in a different sort method?
  • n

    natemccurdy

    07/07/2022, 8:13 PM
    It won’t. Arrays have guaranteed order in puppet.
  • r

    ramindk

    07/07/2022, 8:14 PM
    @natemccurdy ooh interesting. Would you also want to do this with local local hierarchies for modules too. Makes sense that you'd want a standard, "stick this function in your hiera.yaml" sort of solution.
  • r

    ramindk

    07/07/2022, 8:14 PM
    let various teams take advantage of somewhat arbitray ordered naming.
  • n

    natemccurdy

    07/07/2022, 8:15 PM
    Yup. The problem I’m hitting is that we did the long form
    id/%{identifier.0}/%{identifier.1}.yaml
    in a couple places for a few specific use cases, but now every team is copying that in their own modules yet they have entirely different use cases and role names…. which is leading to insanely long hiera hierarchies that are difficult to read. So I’m hoping to be able to collapse all that down into a single entry in the hierarchy, that supports arbitrary array lengths.
  • n

    natemccurdy

    07/07/2022, 8:16 PM
    🤔 I guess I could just make a new ENC or top-scope variable that munges that array into a string delimited by
    /
    ?
  • r

    ramindk

    07/07/2022, 8:18 PM
    hmmm, I'd be tempted to stomp on everyone's private hierarchies and generate a static hierarchy that goes 5-6 levels and tell people that's what they have to use.
    Copy code
    id/%{identifier.0}/%{identifier.1}/%{identifier.2}/%{identifier.3}/%{identifier.4}/%{identifier.5}.yaml
    id/%{identifier.0}/%{identifier.1}/%{identifier.2}/%{identifier.3}/%{identifier.4}.yaml
    etc
  • b

    Brian Schonecker

    07/07/2022, 8:19 PM
    You could create a different variable that takes identifier and "builds" the path based on the array values. $identifier => ['foo', 'bar', 'baz'] $my_hierarchy = 'foo/bar/baz.yaml'.
  • b

    Brian Schonecker

    07/07/2022, 8:19 PM
    I assume identifier is a custom fact.
  • n

    natemccurdy

    07/07/2022, 8:20 PM
    $identifer_paths = $facts['identifier'].join("/")
    Yeah… that could work actually
1...909192...428Latest