Hi, I''d like to be able to create certain admin users on certain machines, and when I saw the new Resources feature, I thought I could use that. But I can''t get it to work. This is what it looks like: <snip> class admin { define adminuser { @user { $name: ensure => present, group => adm } file { "/home/$name": ensure => directory, owner => $name, group => $name, mode => 770 } file { "/home/$name/.ssh": ensure => directory, owner => $name, group => $name, mode => 770 } configfile { "/home/$name/.ssh/authorized_keys": source => "sshkeys/$name_rsa.pub", mode => 600 } } } <snap> I hoped this could be used to realize the admin users I needed, but apparently I''ve got it wrong. -- Med venlig hilsen Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: 70 202 407 / Fax: 33 313 640 www.fab-it.dk / juri@fab-it.dk
Juri Rischel Jensen wrote:> Hi, > > I''d like to be able to create certain admin users on certain > machines, and when I saw the new Resources feature, I thought I could > use that. But I can''t get it to work. This is what it looks like: > > <snip> > class admin { > define adminuser { > @user { $name: > ensure => present, > group => adm > } > file { "/home/$name": > ensure => directory, > owner => $name, > group => $name, > mode => 770 > } > file { "/home/$name/.ssh": > ensure => directory, > owner => $name, > group => $name, > mode => 770 > } > configfile { "/home/$name/.ssh/authorized_keys": > source => "sshkeys/$name_rsa.pub", > mode => 600 > } > } > } > <snap> > > I hoped this could be used to realize the admin users I needed, but > apparently I''ve got it wrong.All of these resources need to be virtual, not just the user. So use ''@file'' and ''@configfile'', in other words. Please let me know if that does not work. -- Fallacies do not cease to be fallacies because they become fashions. --G. K. Chesterton --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Hi Luke On Oct 27, 2006, at 23:01, Luke Kanies wrote:> All of these resources need to be virtual, not just the user. So use > ''@file'' and ''@configfile'', in other words.> Please let me know if that does not work.I''ve tried that, and the error is: err: Could not retrieve configuration: Could not find resource user [jrisch] I''ve attached the file as reference. -- Med venlig hilsen Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: 70 202 407 / Fax: 33 313 640 www.fab-it.dk / juri@fab-it.dk _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Nov 13, 2006, at 8:16 AM, Juri Rischel Jensen wrote:> > I''ve tried that, and the error is: > > err: Could not retrieve configuration: Could not find resource user > [jrisch] > > I''ve attached the file as reference.One of the main problems with your code is that you only define the ''adminuser'' definition, you never call ''adminuser { jrisch: }''. That being said... As is generally guaranteed to happen the day of a release, you seem to have found a couple of bugs. The first one, which I noticed from your problems last week but stupidly did not open a ticket for and thus forgot to fix in this release, is that definitions have to be defined outside of any classes. You''ll need to move the ''adminuser'' definition outside of the ''admin'' class for now. The second is that the ''realize'' function does not appear to work with defined types. It might actually be that collections don''t even work with defined types, even though I have tests that "prove" that they do. I''ve filed both of these as bugs, and I''ll be doing what I can to fix them, but I''ll plan on rolling the fixes into the next release rather than putting out a special one unless someone complains heavily. -- Luke Kanies http://madstop.com | http://reductivelabs.com | 615-594-8199