On Tuesday, January 15, 2013 12:12:18 PM UTC-6, Richard Jacobsen wrote:
>
> Hi everyone.  An example is worth 1000 words, so here's one:
>
> In this example I would like the home directory to be overridden to 
> /testdir/me:
>
> @user { 'me':
>   ensure => present,
>   home => '/home/$title',
>   tag => 'userclass1'
> }
>
> User <| tag == 'userclass1' |> {
>   home => "/testhome/$title"
> }
>
> It actually gets overriden to /testhome/main, 'main' being the class the 
> collector is in, puppet apply tries to:
> '/usr/sbin/useradd -d /testhome/main me'
>
> [...] I'd rather just use the virtual resource's $title.  Is this 
> possible, or am I asking too much from the resource collector?



It is not possible.  Variable references are resolved in the scope in which 
they appear, which in this case is the one provided by the class or defined 
type instance in which the collection is declared.  The collection does not 
establish a new scope.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/3lV68dMQGhQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to