I''m having problem with the following manifest, trying to use a define
as a virtual type:
define adm_user ( $user,
$uid,
$comment,
$sysgroup = "sysadmin",
$shell = "/bin/bash",
$basedir = "/home.local",
$ensure = "present"
) {
group { $user:
gid => $uid,
ensure => $ensure,
allowdupe => false,
}
user { $user:
uid => $uid,
gid => $uid,
comment => $comment,
home => "/home.local/$user",
shell => $shell,
groups => [ "$sysgroup", "users" ],
ensure => $ensure,
allowdupe => false,
membership => minimum,
require => Group[$user],
}
}
class virt_adm_users {
@adm_user { "alice": user => "alice", uid =>
5300, comment =>
"Alice", }
@adm_user { "bob": user => "bob", uid => 5301,
comment => "Bob", }
}
class team_adm_users {
realize(
Adm_user["alice"],
Adm_user["bob"],
)
}
--- END ----
... when I install on node, puppet does not recognise the virtual type:
info: Facts have changed; recompiling
err: Could not retrieve configuration: Failed to find virtual resources
Adm_user[alice], Adm_user[bob]
warning: Could not get config; using cached copy
notice: Starting configuration runnotice: Finished configuration run in
0.87 seconds
What am I doing wrong?! Does Puppet not support using
''define''d types in
a virtual context?
Thanks,
mike
On May 11, 2007, at 11:37 AM, Mike Pountney wrote:> > > What am I doing wrong?! Does Puppet not support using ''define''d > types in > a virtual context?I specifically remember going through a bunch of effort to support this, but... I''m currently getting inconsistent behaviour here. Using the following code: define yep($arg) { exec { "/bin/echo $name: $arg": } } @yep { test1: arg => maybe } @yep { test2: arg => definitely } realize Yep[test1], Yep[test2] The execs get applied even when I comment out the ''realize'' line. I can''t reproduce your error unless I misspell something, but I would still say that virtual defined types are currently broken, since they always get realized, which isn''t correct either. So, I guess I''d say at least in 0.22.4, no, you can''t use virtual defined types. :/ -- Barrow''s first law: Any Universe simple enough to be understood is too simple to produce a mind able to understand it. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Luke Kanies wrote:> I can''t reproduce your error unless I misspell something, but I would > still say that virtual defined types are currently broken, since they > always get realized, which isn''t correct either. > > So, I guess I''d say at least in 0.22.4, no, you can''t use virtual > defined types. :/ > >Shame, thanks for logging the bug and the quick reply. I''ve updated the Virtual Resources page in the wiki to highlight this. Cheers, mike