0

I'm new to puppet and so far I've been doing most of my condition statements using puppet facts which is pretty straightforward. This is what I want to do to make the changes I need. I want to create two groups: nossh with some gid like 100 and another one nosshwpa with gid 101 creating nossh is fine but the problem is some servers already have a group nosshwpass (different group name) with the same gid which serves the same purpose, but to make it consistent with all the other servers, I want to create nosshwpa going forward. So instead of manually changing those first using groupmod or something, I just want to skip over the creation of nosshwpa on those specific servers for now. I'm not really sure how to write a condition statement for this in Puppet. Is there a way to check, for example, is "ensure => present OR ensure => absent" for a given group? So the logic: create nosshwpa IF nosshwpass DOES NOT exist.

I'm not sure if this makes sense. Any input is appreciated. Please let me know if clarification is needed.

shkabaan
  • 3
  • 1

1 Answers1

0

The Puppet server builds a catalog for each target node, which provides the data that the agent uses to manage the node's configuration. It is during the server's catalog-building process that conditional statements in your manifests are evaluated, and the only information that the server has about the current state of (other) nodes is that which is conveyed to it via facts.

If you want to condition catalog building on state details that are not conveyed via Facter's built-in facts then the standard solution involves writing a custom fact.

John Bollinger
  • 160,171
  • 8
  • 81
  • 157