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

    ziggy

    10/05/2022, 5:59 PM
    Speaking of modules, can you perform a hiera lookup() in a separate Puppet module? It appears if I do a lookup in the module, Puppet is trying to perform a lookup(), but returns as null even though it's in hiera within the module. Very odd.
  • z

    ziggy

    10/05/2022, 6:00 PM
    Speaking of modules, can you perform a hiera lookup() in a separate Puppet module vs in puppet-control? It appears if I do a lookup in the module, Puppet is trying to perform a lookup(), but returns as null even though it's in hiera within the module. Very odd.
  • z

    ziggy

    10/05/2022, 6:08 PM
    Great. Will give it a try. Thanks
  • r

    ramindk

    10/05/2022, 6:09 PM
    Depends on how the system uses this data. I would tend to write it this way where I assume the logic built into the module is going to key of the OS and give me roughly the data I want. Then I can mostly skip logic in the manifests.
    Copy code
    class dc_agent(
      String[1] $src_file,
    ) {
    
      file { $src_file: }
    
      if $facts['os']['family'] include ['Debian',RedHat'] {
        contain dc_agent::linux
      } else {
        contain dc_agent::windows
      }
    Copy code
    class dc_agent::linux {
    
       # linux specific thigns here 
    }
  • s

    Slackbot

    10/05/2022, 6:26 PM
    This message was deleted.
    r
    c
    • 3
    • 4
  • w

    William Myers

    10/05/2022, 6:26 PM
    E.G. if you assigned the class desktopcentral_agent:install:linux , would manifests/init.pp still be called?
  • n

    natemccurdy

    10/05/2022, 6:27 PM
    No. The class defined in
    init.pp
    is only declared if you explicitly declare it with something like the
    include
    function.
  • r

    ramindk

    10/05/2022, 6:38 PM
    https://github.com/puppetlabs/puppetlabs-apache/blob/main/manifests/vhost/custom.pp#L24
  • z

    ziggy

    10/05/2022, 6:45 PM
    @natemccurdy so let's say I have something in hiera like:
    Copy code
    module_foo::name:
      cats: 'bar'
    I want to pull that in a class:
    Copy code
    $hiera_key = 'cats'
    
    foo = $module::name::$hiera_key
    How can I assign foo like that? Puppet doesnt seem to let me
  • z

    ziggy

    10/05/2022, 6:45 PM
    @natemccurdy so let's say I have something in hiera like:
    Copy code
    module_foo::name:
      cats: 'bar'
    I want to pull that in a class:
    Copy code
    $hiera_key = 'cats'
    
    foo = $module_foo::name::$hiera_key
    How can I assign foo like that? Puppet doesnt seem to let me
  • a

    Andrew

    10/05/2022, 6:48 PM
    i need to configure some environment variables that will be present during the puppet run. its my understanding i could put these into
    /etc/sysconfig/puppet
    . im just wondering how it works if i add to this file with puppet also. would a run need to complete before the variables are present or is there some other way to configure env vars for a puppet run?
  • w

    William Myers

    10/05/2022, 7:12 PM
    with init.pp , is that what's get called if you were to NOT specify a specific subclass? E.G. class { 'desktopcentral_agent': } opposed to class { 'desktopcentral_agent::install': }
  • n

    natemccurdy

    10/05/2022, 7:13 PM
    Ignore the fact that it’s in
    init.pp
    for a second…. Look at the name of the class defined in init.pp
    this2 1
  • n

    natemccurdy

    10/05/2022, 7:14 PM
    Ignore the fact that it’s in
    init.pp
    for a second…. Look at the name of the class defined in init.pp
  • w

    William Myers

    10/05/2022, 7:14 PM
    Ah, that supports my rough understanding then.
  • w

    William Myers

    10/05/2022, 7:14 PM
    Copy code
    class puppetagent(
  • s

    Slackbot

    10/05/2022, 9:11 PM
    This message was deleted.
    g
    r
    • 3
    • 2
  • g

    glee

    10/05/2022, 9:18 PM
    It's listed in the facter release notes: https://puppet.com/docs/puppet/7/release_notes_facter.html#release_notes_facter_4-2-11
  • w

    William Myers

    10/05/2022, 10:24 PM
    is it pretty easy to publish a module from one environment to aother?
  • w

    William Myers

    10/05/2022, 10:24 PM
    or do a push/sync?
  • w

    William Myers

    10/05/2022, 10:26 PM
    E.G. work on tinkering with and modifying an existing module in test environment, once tested and ready publish sync it to prod. Or is git usually used for this?>> CD to the prod directory for that module and do a pull ?
  • n

    natemccurdy

    10/05/2022, 10:29 PM
    Git is usually used for this. In particular, git branches are used and map 1:1 with Puppet environments.
  • n

    natemccurdy

    10/05/2022, 10:34 PM
    The standard practice is to use a single git repository for your Puppet code, which by convention is called a “control repository”. There are tools out there that will deploy your control repository to your Puppetservers, turning each branch into a Puppet environment. In the open-source world, the most common tool is
    r10k
    . https://puppet.com/docs/pe/2021.7/managing_puppet_code.html This guide covers a lot of these topics, but leans heavily into the Puppet Enterprise features and its code deployment tool called “Code Manager”. However, the basic concepts of using a control repository, how to organize it, and how to deploy one apply to both open-source and Enterprise.
  • s

    Slackbot

    10/05/2022, 10:40 PM
    This message was deleted.
    c
    • 2
    • 1
  • c

    Corporate Gadfly

    10/05/2022, 11:12 PM
    Yes, you can do that with: • pull requests, or • merging directly with Git
  • g

    Gustavo Homem

    10/06/2022, 12:54 AM
    @William Myers I use a repository for each module developed by my teams and two repositories for node declarations: one for staging nodes and another for production nodes
  • s

    sameer

    10/06/2022, 6:34 AM
    and this parameter in role:muleserver $configure_apache=true if ( $configure_apache == true ) { include apache } else { } not sure if its correct
  • s

    sameer

    10/06/2022, 7:17 AM
    message has been deleted
  • s

    sameer

    10/06/2022, 7:17 AM
    message has been deleted
  • s

    Slackbot

    10/06/2022, 9:04 AM
    This message was deleted.
    z
    m
    c
    • 4
    • 6
1...185186187...428Latest