new question ... using the `puppetlabs/node_manage...
# puppet-enterprise
j
new question ... using the
puppetlabs/node_manager
module https://forge.puppet.com/modules/puppetlabs/node_manager/reference ... the documentation in
REFERENCE.md
is very weak ... right now the code which uses the module looks like this:
Copy code
node_group { 'PE Console' :
      classes => {
        'puppet_enterprise::profile::console' => {
          'browser_ssl_cert'        => $cer_file ,
          'browser_ssl_private_key' => $key_file ,
        } ,
      } ,
    }
first question: is this ADDING two parameters, or is it SETTING the entire list of parameters for that class?
(related: is this only affecting that one class, or would it impact other classes in the same node group?)
second question: how does one DELETE parameters from a specific class in a node group, without affecting other parameters of the same class, or other classes in the same node group?
i ask because i was told to delete parameters like this:
Copy code
node_group { 'PE Console' :
      classes => {
        'puppet_enterprise::profile::console' => {
          'browser_ssl_cert'        => undef ,
          'browser_ssl_private_key' => undef ,
        } ,
      } ,
    }
but when i do this, every agent run produces this output:
Copy code
Notice: /Stage[main]/Xxx_pe_server/Node_group[PE Console]/classes: classes changed {
  'puppet_enterprise::profile::console' => {

  }
} to {
  'puppet_enterprise::profile::console' => {
    'browser_ssl_cert' => undef,
    'browser_ssl_private_key' => undef
  }
} (corrective)
b
the API is a bit special. I diff the existing settings vs the settings I want. And only apply the resource when a diff exists
j
the other thing is, if i change the
node_group
declarations to
pe_node_group
, it doesn't show the "changed class-empty to class-has-two-undefs" notice
looking at that ... it looks like you're building up the new state of the entire node group in memory and declaring it that way, rather than "adding" or "removing" things without touching whatever else may be in the group ... correct?
b
yes
j
(1) that's what i was afraid of, and (2) thanks for an example of how to do all that. if nothing else, your example makes it clearer what the
node_groups()
function does, where the documentation has the WONDERFULLY helpful ...
image.png
(let's hear it for great documentation, eh?)