Re: [Puppet Users] Re: class + each do

2011-03-07 Thread Peter Meier
 You made a class for it? As it sounds like it's not getting called at all.

 Yes.I did a class for this:

are you including this class somewhere?

~pete

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: class + each do

2011-03-04 Thread Ben Hughes
On Thu, Mar 03, 2011 at 11:59:25PM -0800, aleksey_k wrote:

  # puppet agent --test

Throw a --debug on the end, and it should be a whole more talkative!

 puppetmaster:
 #grep -i keys node/test-nodes.pp
 include keys

You made a class for it? As it sounds like it's not getting called at all.

-- 
Ben Hughes || http://www.puppetlabs.com/

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: class + each do

2011-03-04 Thread aleksey_k
On 4 мар, 13:08, Ben Hughes b...@puppetlabs.com wrote:
 On Thu, Mar 03, 2011 at 11:59:25PM -0800, aleksey_k wrote:
   # puppet agent --test

 Throw a --debug on the end, and it should be a whole more talkative!

Outpu here - http://pastebin.com/0GHfkH63

 You made a class for it? As it sounds like it's not getting called at all.

Yes.I did a class for this:

class keys {

define userkey() {
file { /etc/file/keys/${name}_keys:
#ensure = ,
owner   = $name,
group   = root,
mode= 440,
replace = true,
source  = puppet://server/files/file/keys/${name}
_keys,
require = User[$name],
}

userkey{ [user1,user2,user3]:

}

}

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: class + each do

2011-03-04 Thread Felix Frank
On 03/04/2011 09:08 AM, Ben Hughes wrote:
 On Thu, Mar 03, 2011 at 11:59:25PM -0800, aleksey_k wrote:
 
 # puppet agent --test
 
 Throw a --debug on the end, and it should be a whole more talkative!
 
 puppetmaster:
 #grep -i keys node/test-nodes.pp
 include keys
 
 You made a class for it? As it sounds like it's not getting called at all.
 

On such occasions, I prefer --test --evaltrace over --debug. Your files
should show up in there. If not, your manifest is probably erronous.

HTH,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: class + each do

2011-03-04 Thread Stefan Schulte
On Fri, Mar 04, 2011 at 02:24:59AM -0800, aleksey_k wrote:
 On 4 мар, 13:08, Ben Hughes b...@puppetlabs.com wrote:
  On Thu, Mar 03, 2011 at 11:59:25PM -0800, aleksey_k wrote:
# puppet agent --test
 
  Throw a --debug on the end, and it should be a whole more talkative!
 
 Outpu here - http://pastebin.com/0GHfkH63
 
  You made a class for it? As it sounds like it's not getting called at all.
 
 Yes.I did a class for this:
 

Your code

01 class keys {
02  define userkey() {
03file { /etc/file/keys/${name}_keys:
04  #ensure = ,
05  owner   = $name,
06  group   = root,
07  mode= 440,
08  replace = true,
09  source  = puppet://server/files/file/keys/${name}_keys,
10  require = User[$name],
11}
12
13   userkey{ [user1,user2,user3]: }
14
15 }

My comments

04: Use `ensure = file` so it is clear that something will be created
08: replace = true is the default so I wont specify it
09: Are you using modules? Maybe you're specifying an incorrect path. Have
a look at http://docs.puppetlabs.com/guides/modules.html and 
http://docs.puppetlabs.com/guides/file_serving.html
10: When you specify the owner of the file, puppet will create an
implicit require you dont dont need that explicit require
12: There is a missing closing bracket for the define

-Stefan


pgpIGlyfZy6Uf.pgp
Description: PGP signature


[Puppet Users] Re: class + each do

2011-03-03 Thread aleksey_k
On 4 мар, 11:00, Ben Hughes b...@puppetlabs.com wrote:
 On Thu, Mar 03, 2011 at 09:39:02PM -0800, aleksey_k wrote:
  Hi. i have keys class where I copy some files from puppet server.

 You're trying to do ERB templating in a manifest. You can't do that.

 You could use the ruby DSL, or in puppet language, try the following:

 define userkey() {
     file { /etc/file/keys/${name}_keys:
             owner   = $name,
             group   = root,
             mode    = 0440,
             replace = true,
             source  = puppet://server/files/file/keys/${name}_keys,
             require = User[$name],
     }

 }

 userkey{ [user1,user2,user3]:

 }

 --
 Ben Hughes ||http://www.puppetlabs.com/

Hi. I done that:
#cat keys.pp
class keys {

define userkey() {
file { /etc/file/keys/${name}_keys:
#ensure = ,
owner   = $name,
group   = root,
mode= 440,
replace = true,
source  = puppet://server/files/file/keys/${name}
_keys,
require = User[$name],
}


userkey{ [user1,user2,user3]:

}
}

But puppet client don't copy file from puppet server :(

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: class + each do

2011-03-03 Thread Ben Hughes
On Thu, Mar 03, 2011 at 11:20:38PM -0800, aleksey_k wrote:

 But puppet client don't copy file from puppet server :(

Anything in the output or logs at all?

Stop the client and run:

# puppet agent --test

and that should give you more information as to why.

-- 
Ben Hughes || http://www.puppetlabs.com/

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: class + each do

2011-03-03 Thread aleksey_k
On 4 мар, 12:23, Ben Hughes b...@puppetlabs.com wrote:
 On Thu, Mar 03, 2011 at 11:20:38PM -0800, aleksey_k wrote:
 # puppet agent --test

puppetmaster:
#grep -i keys node/test-nodes.pp
include keys

puppetclient:
#puppetd --version
2.6.2

#puppetd --test
info: Caching catalog for test-node
info: Applying configuration version '1299224725'
notice: Finished catalog run in 2.00 seconds

Log's from puppetmaster:

ip - - [04/Mar/2011:12:49:42 +0500] GET /mera/file_metadata/files/
soft/zabbix-agent_1.8.3-2_i386.deb HTTP/1.1 200 314 - -
ip - - [04/Mar/2011:12:49:44 +0500] GET /mera/file_metadata/files/
once HTTP/1.1 200 278 - -
ip - - [04/Mar/2011:12:49:44 +0500] PUT /mera/report/test-node HTTP/
1.1 200 24 - -

I don't got some error or warning.

Also when I add to array userkey nonexistent user I don't got error
that file not found...

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.