camptocamp / puppet-accounts

11 stars 40 forks source link

Can you add accounts using a yaml file instead of a manifest #50

Closed lancherider closed 7 years ago

lancherider commented 7 years ago

Trying to add users to individual nodes in hiera. It works fine in a manifest using:

accounts::account { 'user': }

But this adds the account to every node using that manifest, which is not what I want. When I try to add it in hiera in a node-specific yaml file using: accounts::account: user:

The account does not get created. How do I create the accounts in a yaml file?

lancherider commented 7 years ago

I figured it out. I use the create_resources function like so:

create_resources('accounts::account', hiera('extra_accounts'))

Then my yaml files have

extra_accounts:
  user1: {}
  user2: {}