1

Using Hiera, is it possible to instantiate two classes with different properties?

I know I can do add to my node declaration:

user{'francois':
  uid => 1000,
  # ...
}

user{'julien':
  uid => 1001,
  # ...
}

Is there a way to do this from Hiera?

  • 1
    For **classes**, this is not possible, with or without Hiera. For **resources** (as in your example with users), it is quite simple, yes. – Felix Frank Dec 03 '14 at 13:18

1 Answers1

3

Use hashes for your data and use create_resources to instantiate.

The Puppet documentation has an example for users. The StackOverflow question Puppet hiera and create_resource issue covers basically the same problem.

mschuett
  • 3,146
  • 21
  • 21