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

    Scott Macmillan

    03/24/2023, 3:29 PM
    Hey folks. Maybe you all know a solution to this. I have a new role that inherits ultimately from our base role. In the base role, we include a module that I will use in the child role, but with a lot of different settings. I’d like to be able to include these settings in the child role’s
    .pp
    file (in large part because it’s a lot of hiera across multiple machines), but the only way I know to include it there is to declare the class, and I get an error for declaring that class twice. I have ways I can de-duplicate the hiera, but I was wondering if there’s a way to include all these settings in the child role
    .pp
    . Thanks for any ideas you might have.
  • r

    rnelson0

    03/24/2023, 4:22 PM
    To some extent, not really. You can test if it's defined before instantiating it to prevent the duplicate class error, but then you're at the whims of "who called it first?". So
    include classname
    twice is the safest way to have a class in two places.
  • r

    rnelson0

    03/24/2023, 4:23 PM
    Not knowing anything else about your setup, ironing out hiera seems like the best solution. However, if you can not include it for some systems and include it for others maybe that makes more sense?
  • n

    natemccurdy

    03/24/2023, 4:23 PM
    Yup, +1 to that ☝️ . Long story short, no. And this problem is exactly what Hiera is good at solving.
  • r

    rnelson0

    03/24/2023, 4:25 PM
    For instance in profile::base add a
    managed_service
    parameter that defaults to true and put an
    if ($managed_service) { }
    block around the normal
    include
    . Set it to false for this one client and then add profile:service:specialclient to that client's role and hardcode stuff there in an explicit
    resourcename { 'title': ... }
    block. I still would want to iron out hiera and make things simpler but sometimes this IS the only way, at least in the short term, so it's a valid trick to keep in your back pocket.
  • k

    Ken

    03/24/2023, 5:25 PM
    I can confirm my own 'helloworld' app loads and runs fine, but puppetboard module is still not found. If anyone has a solution I'd be much appreciative!
  • s

    Scott Macmillan

    03/24/2023, 6:03 PM
    @rnelson @natemccurdy Gotcha. Thanks! I may be able to work with that possible solution, @rnelson. Appreciated.
  • s

    Scott Macmillan

    03/24/2023, 6:04 PM
    That said, I will likely just use a hiera solution. 🙂
    👍 1
  • c

    canihavethisone

    03/25/2023, 12:50 AM
    Hi all, just flagging 3 feature requests I have post at https://github.com/puppetlabs/puppetlabs-wsus_client/issues. Keen for peer comment, sanity check etc (should I move this to #C0W1X7ZAL ?)
  • c

    canihavethisone

    03/25/2023, 12:51 AM
    Hi all, just flagging 3 feature requests I have post at https://github.com/puppetlabs/puppetlabs-wsus_client/issues. Keen for peer comment, sanity check etc (should I move this to #puppet-dev ?)
  • s

    Slackbot

    03/25/2023, 1:27 AM
    This message was deleted.
    n
    n
    y
    • 4
    • 11
  • n

    Nigel

    03/25/2023, 2:49 AM
    I am looking at using the firewalld module: https://forge.puppet.com/modules/puppet/firewalld/readme#firewalld-zones I have it installed by the usage here always gets me:
    class { 'firewalld' : }
    Does this mean I need to write my own class or do I include this class statement inside my class where i am trying to use it. e.g. a base class.
  • n

    natemccurdy

    03/25/2023, 4:23 AM
    You'd declare the
    firewalld
    class where needed. There are two'ish ways to declare (i.e. use) classes in Puppet. The first is with the
    include
    function:
    Copy code
    include firewalld
    The second is using the resource-like syntax:
    Copy code
    class { 'firewalld': }
    Both of these are essentially the same. They declare the class with all defaults for any parameters it might have. Best practice though is to just use
    include
    when you don't need to specify a class parameter.
  • h

    Herve Meftah

    03/25/2023, 6:16 AM
    Hello
  • s

    Slackbot

    03/25/2023, 6:20 AM
    This message was deleted.
    c
    h
    • 3
    • 2
  • n

    Nigel

    03/25/2023, 7:11 AM
    Thanks for the reply.
  • s

    Slackbot

    03/25/2023, 4:03 PM
    This message was deleted.
    b
    h
    +3
    • 6
    • 33
  • y

    Yury Bushmelev

    03/25/2023, 4:27 PM
    yes, you can.. but is the repo, where you’d like to get the latest release from, and the repo, where you’d like to checkout it, the same dir?
  • d

    Damian

    03/27/2023, 11:22 AM
    Hi guys! I need
    Puppet master 4.10.1
    and
    puppet agent 1.10.1
    rpm packages to install in
    CentOS7
    . Could you give me a link to download them? Thanks!
  • r

    ripienaar

    03/27/2023, 1:03 PM
    you’ll have to go look at https://release-archives.puppet.com
  • r

    ripienaar

    03/27/2023, 1:03 PM
    these versions has been unsupported for like most of a decade now
  • y

    Yorokobi

    03/27/2023, 1:04 PM
    IIRC, CentOS 7 will be in the same state later this year.
  • s

    Slackbot

    03/27/2023, 5:39 PM
    This message was deleted.
    b
    b
    y
    • 4
    • 15
  • b

    Brian Schonecker

    03/27/2023, 5:40 PM
    Is there a Puppet module equivalent to Anbile URI? I need to build some servers on the fly and then send API calls to the servers in order to configure them. I'm very familiar with Ansible but I want to limit any creep with configuration management. Is Puppet the right tool? I'm OK with using Ansible if necessary.
  • b

    Brian Schonecker

    03/27/2023, 5:41 PM
    Is there a Puppet module equivalent to Anbile URI? I need to build some servers on the fly and then send API calls to the servers in order to configure them. I'm very familiar with Ansible but I want to limit any creep with configuration management. Is Puppet the right tool? I'm OK with using Ansible if necessary. I have a task to build a set of servers with Terraform and then configure them via code. I've got the software on the servers installed but I need to configure them as well.
  • b

    Brian Schonecker

    03/27/2023, 7:28 PM
    Is "%{alias('hiera_value')}" a safe and direct replacement for %lookup? I've run into the issue where %lookup returns a string when I really need an integer. Since %alias solve my data type issue, I'm considering replacing %lookup with %alias everywhere in my contro-repo.
  • n

    natemccurdy

    03/27/2023, 7:34 PM
    @Brian Schonecker No. One big difference between the two is that
    %{lookup('foo')}
    can be interpolated into a larger string while
    %{alias('foo')}
    can not be interpolated into a larger string.
  • b

    Brian Schonecker

    03/27/2023, 7:35 PM
    I've got a module that expects an integer and the %lookup was casting the variable to a string. There are a few other places where an integer is more appropriate so I'll change to %alias. Thank you.
  • s

    Slackbot

    03/27/2023, 8:11 PM
    This message was deleted.
    c
    r
    +2
    • 5
    • 4
  • c

    Corporate Gadfly

    03/27/2023, 8:53 PM
    @Brian Schonecker: Based on my limited needs, I wrote my own small manifest which manages
    /etc/nsswitch.conf
    with augeas and
    sssd.conf
    with
    inifile::create_ini_settings
    . No knock against existing modules and YMMV.
1...337338339...428Latest