Ask Your Question
0

Interdependent resource definitions

asked 2014-04-01 09:44:52 -0600

mzandstra gravatar image

I think the title says it all. The following fails due to 'missing dependencies' since the users depend on each other:

  user { 'user1':
    ensure => 'present',
    password => '.......'
    groups => ['user2'],
  }

  user { 'user2':
    ensure => 'present',
    password => '......'
    groups => ['user1'],
  }
edit retag flag offensive close merge delete

Comments

Not only would that fail from puppet, it would also fail from the command line (useradd can't add a user to a non existent group). Are you looking for an alternative?

spuder gravatar imagespuder ( 2014-04-01 10:02:22 -0600 )edit

I would think puppet would look at this, add the two users, then set the groups. Would the solution be to create 'group' resources first, then the two users?

mzandstra gravatar imagemzandstra ( 2014-04-01 10:36:33 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-04-01 12:55:07 -0600

lavaman gravatar image

You'll need to manage the groups as separate resources and have the user resources require them.

edit flag offensive delete link more

Comments

Right, though I do believe that the user resource will autorequire the group resource. Adding an explicit require is redundent, but not harmful.

ffrank gravatar imageffrank ( 2014-04-03 07:46:30 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-04-01 09:44:52 -0600

Seen: 37 times

Last updated: Apr 01 '14