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

    bastelfreak

    06/30/2023, 8:38 AM
    it depends ๐Ÿ™‚ You can add a variable to a class like $package and in hiera you have different hierarchies per OS and you define the parameter in each hierarchy
  • b

    bastelfreak

    06/30/2023, 8:38 AM
    or you check the OS and include a different class per OS
  • s

    Slackbot

    06/30/2023, 8:38 AM
    This message was deleted.
    โœ… 1
    ๐Ÿ˜ 2
    y
    b
    +2
    • 5
    • 4
  • y

    Yury Bushmelev

    06/30/2023, 8:39 AM
    Yeah, Iโ€™d say you need few os-specific profiles to setup things and then use OS hiera layers to lookup for a package names e.g.
  • t

    tuxmea

    06/30/2023, 8:50 AM
    most imortant: you dont have to deal with yum or dnf or apt. package resource handles this by itself.
  • d

    David Sandilands

    06/30/2023, 10:07 AM
    @matt the old blog post about where to put data can be useful https://www.puppet.com/blog/hiera-data I would just say it does depend on how many OS you intend to do. I would always recommend doing it simplest way you can first and refactoring if it does become more complicated later.
    ๐Ÿ‘€ 1
  • m

    matt

    06/30/2023, 10:21 AM
    great input, thank you !
  • m

    matt

    06/30/2023, 10:21 AM
    I can see a mistake I was making already, I was trying to do it in the class, rather than in hiera
  • d

    David Sandilands

    06/30/2023, 10:37 AM
    its that thing of if there's not that much data its simpler just to do it directly in the class like Tims example. If it starts feeling complex to do in the class then it could well be time to look at hiera.
  • m

    matt

    06/30/2023, 10:49 AM
    the examples don't take that into account, and so my own experience was conflicting with the options / suggestions from examples
  • t

    tuxmea

    06/30/2023, 2:32 PM
    Are there any know issues with Puppet DSL functions and catalog compilation isolation? We have a customer (PE) who has config flapping between cluster nodes.
  • r

    rismoney

    06/30/2023, 3:47 PM
    is this considered a legacy fact usage? include "editor::${::kernel}" ?
  • r

    RyChannel

    06/30/2023, 3:47 PM
    kernel is a legacy fact
  • r

    rismoney

    06/30/2023, 3:48 PM
    so what would be the right format for that ?
  • r

    RyChannel

    06/30/2023, 3:48 PM
    or I thought it was
  • r

    RyChannel

    06/30/2023, 3:49 PM
    Being a legacy fact shouldn't affect format BUT the "best practice" way of using a fact these days is using the $facts array
  • r

    RyChannel

    06/30/2023, 3:49 PM
    So $facts['kernel'
  • r

    RyChannel

    06/30/2023, 3:49 PM
    $facts['kernel']
  • r

    RyChannel

    06/30/2023, 3:49 PM
    IF you have to put it in a string like that... then...
  • r

    RyChannel

    06/30/2023, 3:50 PM
    ${facts['kernel']} I believe
  • b

    bastelfreak

    06/30/2023, 3:50 PM
    kernel
    is not a legacy fact
  • r

    RyChannel

    06/30/2023, 3:50 PM
    kernel is not a legacy fact
  • b

    bastelfreak

    06/30/2023, 3:50 PM
    but accessing it via topscope is deprecated
  • r

    RyChannel

    06/30/2023, 3:50 PM
    jinx
  • b

    bastelfreak

    06/30/2023, 3:50 PM
    ๐Ÿ™‚
  • r

    RyChannel

    06/30/2023, 3:51 PM
    I think I've just assumed at this point that if its not part of a structured fact it must be legacy lol, I've had to change so many of them in our code.
  • r

    RyChannel

    06/30/2023, 3:51 PM
    "Thanks a lot PDK / CD4PE"
  • r

    rismoney

    06/30/2023, 3:52 PM
    yea, thats where i am at rychannel. trying to get a catalog compilation in my ci/cd on 8.1, and def having a go at it.
  • r

    rismoney

    06/30/2023, 3:53 PM
    so this would be proper supported replacement: include "editor::${facts['kernel']}" ?
    ๐Ÿ‘ 2
  • b

    bastelfreak

    06/30/2023, 3:54 PM
    yes
1...386387388...428Latest