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

    Jason Grammenos

    09/29/2022, 5:53 PM
    but i want the variable (service_specific) available at node scope
  • j

    Jason Grammenos

    09/29/2022, 5:53 PM
    not inside a class
  • h

    hbui

    09/29/2022, 5:54 PM
    you are just doing a
    lookup('mysupernodevariable')
    in the manifest code for nodename.test.internal?
  • j

    Jason Grammenos

    09/29/2022, 5:54 PM
    Copy code
    node 'nodename ' {
     $service_specific
    
    class { 'a' }
    }
    and i want to have that variable auto loaded from hiera
  • j

    Jason Grammenos

    09/29/2022, 5:55 PM
    a lookup might work, if there is a way to reference the variable
  • j

    Jason Grammenos

    09/29/2022, 5:55 PM
    a lookup might work, if there is a way to reference the variable
  • h

    hbui

    09/29/2022, 5:55 PM
    if you want data from hiera that is not part of a module's parameter namespace, then you can only use the lookup function
  • j

    Jason Grammenos

    09/29/2022, 5:55 PM
    ok, thanks, that clears things up
  • j

    Jason Grammenos

    09/29/2022, 5:55 PM
    ok, thanks, that clears things up
  • h

    hbui

    09/29/2022, 5:55 PM
    remember hiera is just a key/value store
  • j

    Jason Grammenos

    09/29/2022, 5:56 PM
    i will probably end up wrapping the module in class, so that there is a class level variable avalible for auto lookup
  • h

    hbui

    09/29/2022, 5:56 PM
    generally speaking, I'm not a fan of direct hiera lookups from manifest code, it feels like the equivalent of using global variables. I'd much rather write a module and make the data a parameter to the module or make the variable a fact
  • j

    Jason Grammenos

    09/29/2022, 5:57 PM
    agreed, lookup feel to "magic" varibable
  • h

    hbui

    09/29/2022, 5:57 PM
    you might look at the roles and profiles pattern
  • j

    Jason Grammenos

    09/29/2022, 5:58 PM
    the module isnt mine, so adding a variable to the module is something i want to avoid, so i will just end up wrapping it in a class, to that there are class scope variables avalible inside the module
  • j

    Jason Grammenos

    09/29/2022, 5:58 PM
    the module isnt mine, so adding a variable to the module is something i want to avoid, so i will just end up wrapping it in a class, to that there are class scope variables avalible inside the modules
  • j

    Jason Grammenos

    09/29/2022, 5:58 PM
    the module isnt mine, so adding a variable to the module is something i want to avoid, so i will just end up wrapping it in a class, to that there are class scope variables avalible inside the module
  • h

    helindbe

    09/29/2022, 5:58 PM
    If you have it as a class parameter and also need it as a separe value to lookup you can use an alias in hiera - then you only have one place to maintain that value.
  • h

    helindbe

    09/29/2022, 5:59 PM
    If you have it as a class parameter and also need it as a separe value to lookup you can use an alias in hiera - then you only have one place to maintain that value.
  • h

    hbui

    09/29/2022, 6:00 PM
    Copy code
    class profile::a (
      classa_param1,
      classa_param2,
      my_param1,
    ){
      class { 'a':
        param1 => $classa_param1,
        param2 => $classa_param2,
        param3 => 'hardcoded since its always the same here',
        ...
      }
      if $my_param1 == 'b' {
        file { 'b': ... }
      else
        file { 'c': ... }
      }
    }
  • j

    Jason Grammenos

    09/29/2022, 6:00 PM
    thank @hbui, that is a intersting idea, but does not match how my code base is structured.
  • h

    hbui

    09/29/2022, 6:01 PM
    you can expose the parameters of class a that you want to allow changing and hard code the other params (or accept defaults) and then add whatever other bits are needed for making the technology that class a provides work
  • j

    Jason Grammenos

    09/29/2022, 6:01 PM
    ya, that makes sense. Thank you
  • s

    Slackbot

    09/30/2022, 12:19 AM
    This message was deleted.
    👍 3
    m
    r
    • 3
    • 13
  • s

    Slackbot

    09/30/2022, 11:45 AM
    This message was deleted.
    s
    p
    • 3
    • 6
  • s

    Slackbot

    09/30/2022, 11:51 AM
    This message was deleted.
    b
    f
    • 3
    • 5
  • f

    fayegibbins12

    09/30/2022, 11:52 AM
    Hi Folks, How may one run eyaml more securely by passphasing (or other wise increasing the security of) the private key eyaml needs to keep next to the puppetserver (on the file system) please.
  • r

    rismoney

    09/30/2022, 12:26 PM
    Question about performance analysis, on a non-changing windows node. transaction_evaluation @20sec, catalog_application 20sec, plugin_sync 18sec. i spend 7sec in exec, and 5sec in fact generation. I am a unique monolith include every module catalog. On linux its much much lower. Is my design just hampering me?
  • r

    rismoney

    09/30/2022, 12:28 PM
    i should say thats in debug mode. in general my #s are half that. but wondering if i should still be striving for under 15sec total catalog application time. like is 5 sec possible?
  • r

    ramindk

    09/30/2022, 3:57 PM
    Generally Puppet doesn't make many statements around Agent application times because it's so different between systems. The number of facts, files being applied, etc can vastly change this. For example at past job, the standard agent apply time was 120s. However that system was using Puppet as a file distribution system and needed to check 1000s of files. Most other system I've worked on tend to apply in 10-30s with 1500+ total resources. You might look into the Exec resources on your Windows machine. Possible there are more native ways to do it and you have older modules that are relying on a lot of Powershell. Or Powershell is the best way to do it and it's just ecosystem overhead for that type of resource management. fwiw, I don't think there is much value in bring apply times down from 20s to 5s.
1...178179180...428Latest