I'm trying to add a require to the default resource for users in Puppet:
User { require => Mount['/home'] }
Using Puppet 0.25, I get the following error:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '+>'; expected '}' at /home/rpinson/puppetmaster/manifests/foo.pp:71 on node ip-bar.internal
Is there a way to achieve that?
In this case, it might be easier to leverage a define resource instead of resource defaults.
If you declare myuser{ 'johndoe': }, it should also have mount as a requirement.
Use a resource collector:
This adds the requirement to all User instances, but also has a side-effect of realizing any virtual users.
As far is I remember, this is supported in 0.25.
Also,
+>
operator cannot be used in regular parameter definitions, only in overrides or collectors. Replace those with=>
.