Hi, Stefan. I can't reproduce this on my 2.6.4 machines. Here's what
I've got:
# moduledir/autoreqproblems/manifests/init.pp
class autoreqproblems {}
# moduledir/autoreqproblems/manifests/myfile.pp
class autoreqproblems::myfile {
file {"/tmp/myfile":
ensure => file,
owner => "davexx",
}
}
# moduledir/autoreqproblems/manifests/myuser.pp
class autoreqproblems::myuser {
user {"davexx":
home => '/home/someplace',
ensure => present,
managehome => true,
}
}
# site.pp
node 'barn2.magpie.lan' {
include autoreqproblems::myfile
}
[root@barn2]# puppet agent --test
info: Retrieving plugin
info: Loading facts in testfact
info: Loading facts in testfact
info: Caching catalog for barn2.magpie.lan
info: Applying configuration version '1299869350'
err: /Stage[main]/Autoreqproblems::Myfile/File[/tmp/myfile]/ensure:
change from absent to file failed: Could not set 'file on ensure:
Could not find user davexx at /etc/puppetlabs/puppet/modules/
autoreqproblems/manifests/myfile.pp:5
[root@barn2]# ls -lah /tmp
total 40K
drwxrwxrwt 4 root root 4.0K Mar 11 10:49 .
drwxr-xr-x 25 root root 4.0K Dec 16 16:19 ..
drwxrwxrwt 2 root root 4.0K Dec 16 16:19 .font-unix
drwxrwxrwt 2 root root 4.0K Dec 16 16:19 .ICE-unix
-rw------- 1 root root 0 Jan 3 14:01 mutt-barn2-6984-0
-rw-r--r-- 1 root root 0 Mar 11 10:49 myfile
[root@barn2]# puppet resource user davexx
user { 'davexx':
ensure => 'absent'
}
Am I missing something? How can I reproduce your issue?
On Mar 10, 1:09 pm, Stefan Baryakov <[email protected]> wrote:
> Thanks for the response.
> What is the scope of "if myresource exists" part? From what I can tell
> it looks also in modules which are not included for given node.
>
> In my example
>
> Modules:
> class myuser {user {"myuser": homedir => /someplace } }
> class myfile { file {"myfile": owner => "myuser" }}
>
> node mynode { include myfile }
>
> In that case the homedir of myuser on mynode gets changed.
>
> Thanks
> Stefan
>
> On Mar 10, 9:47 pm, Patrick <[email protected]> wrote:
>
>
>
>
>
>
>
> > On Mar 10, 2011, at 12:42 PM, Stefan Baryakov wrote:
>
> > > The problem is that if you mention that user in some resource, lets
> > > say file{owner}, the class managing that user gets included form the
> > > auto-require even though it is not included by the external node
> > > classifier.
>
> > Auto-require won't include a resource. It mostly works like this:
>
> > autorequre(myresource)
> > if myresource exists
> > require(myresource)
> > end if
> > end autorequire
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
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.