[Puppet Users] Cleanup after timeout in exec resource

2010-12-17 Thread Erwin Bolwidt

Hi,

When I use an exec resource to create a file, a timeout may occur. As an 
example, I can run wget to get a file (not the most elegant solution but 
necessary sometimes), or run some other program that depends on the 
network to get some data that is necessary to create the file.


This timeout itself is fine, I could increase the timeout, but there are 
still cases where I would want puppet to stop after this timeout.


Problem is, what if the file was partially created? I use an exec 
resource with the creates attribute, so the next time puppet runs, it 
thinks that the exec resource has been satisfied, and it doesn't run the 
command again.


Then I'm left, for example, with a half-downloaded file.

Is there some way to do cleanup after a timeout?
I'm thinking something like the ability to run another shell command on 
timeout, or perhaps a way to specify that the "creates" file should be 
deleted if a timeout occurs.


Does something like this exist?

Regards,
  Erwin Bolwidt

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@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] Help with Puppet install on OS X Server

2010-12-17 Thread Gary Larizza
Brian,

I've got a bunch of OS X/Puppet info here -->
http://links.huronstudents.com/puppet ; maybe it will be helpful?

Gary

On Friday, December 17, 2010, Brian LaShomb  wrote:
> Ah Yes, it is working... I guess I made it more complicated than in 
> needed to be. Thanks again!
>
> On Fri, Dec 17, 2010 at 12:51 PM, Nigel Kersten  wrote:
> On Fri, Dec 17, 2010 at 9:02 AM, Brian LaShomb  wrote:
>> Nan, MacPorts ended up the same.
>> This is where it ends up...
>> https://img.skitch.com/20101217-c2jbed6q8psp6r8yqr3gfd8ayr.jpg
>> When I run it without debug, the last line output is "notice: Starting
>> Puppet master version 2.6.4"
>> I'm gonna try it on a linux distro as I have no experience with it running
>> (or setting any nodes up), so I'm really flying blind.
>
> That looks like a working daemon to me Brian.
>
> Can you connect to it?
>
>>
>> On Fri, Dec 17, 2010 at 9:39 AM, Nigel Kersten  wrote:
>>>
>>> On Fri, Dec 17, 2010 at 7:33 AM, Brian LaShomb  wrote:
>>> > Thanks Nigel,
>>> > I deleted the /etc/puppet and /var/lib/puppet directories and then
>>> > recreated
>>> > the /var/lib/puppet directory with puppet user/group ownership. I then
>>> > reran
>>> > the package installers. No more rrd error. But it still hangs on the
>>> > "Finishing Transaction" line. I had already created the puppet user and
>>> > group ahead of time.
>>> > Thought I might need to create that site.pp manifest again, so I did the
>>> > same and reran puppetmasterd, still hangs in the same place.
>>>
>>> Are you sure it's actually hung rather than just running as a daemon?
>>>
>>> Can nodes connect to it and do things?
>>>
>>> I won't be online for a little while, but if you should be able to get
>>> a hand on our IRC channel #puppet
>>>
>>> http://projects.puppetlabs.com/projects/puppet/wiki/Irc_Channel
>>>
>>>
>>>
>>> >
>>> >
>>> >
>>> >
>>> > On Thu, Dec 16, 2010 at 6:02 PM, Nigel Kersten 
>>> > wrote:
>>> >>
>>> >> On Thu, Dec 16, 2010 at 1:40 PM, Brian LaShomb 
>>> >> wrote:
>>> >> > Hi all... finally getting around to trying Puppet, I'm excited to get
>>> >> > started, but I'm stuck on install. My server a 3-month old Xserve
>>> >> > with
>>> >> > 6GB
>>> >> > of RAM. Didn't configure any other services for it yet, and I tried
>>> >> > installing puppet and facter 3 different ways (because I thought the
>>> >> > missing
>>> >> > rrd directory could've been an install glitch).
>>> >> > First I tried downloading from puppetlabs.com and using 'ruby
>>> >> > install'.
>>> >> > Second, I tried the packages for OS X (linked to from Puppet's site).
>>> >> > Third
>>> >> > I tried 'gem install'.
>>> >> > After install, I create a file called site.pp at
>>> >> > /etc/puppet/manifests
>>> >> > with
>>> >> > the following. I change this file to puppet user and group
>>> >> > permissions.
>>> >> >
>>> >> > file { "/etc/passwd": owner => "root",
>>> >> >
>>> >> > group => "bin", mode => 644,
>>> >> >
>>> >> > }
>>> >> >
>>> >> > Then I start puppet using:   sudo puppetmasterd --verbose --debug
>>> >> > --no-daemonize
>>> >> > The end of the output shows:
>>> >> > err: /File[/var/lib/puppet/rrd]/ensure: change from abse
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@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.
>

-- 
Gary Larizza

Director of Technology
Huron City Schools
http://www.huronhs.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-us...@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] Help with Puppet install on OS X Server

2010-12-17 Thread Brian LaShomb
Ah Yes, it is working... I guess I made it more complicated than in
needed to be. Thanks again!

On Fri, Dec 17, 2010 at 12:51 PM, Nigel Kersten wrote:

> On Fri, Dec 17, 2010 at 9:02 AM, Brian LaShomb  wrote:
> > Nan, MacPorts ended up the same.
> > This is where it ends up...
> > https://img.skitch.com/20101217-c2jbed6q8psp6r8yqr3gfd8ayr.jpg
> > When I run it without debug, the last line output is "notice: Starting
> > Puppet master version 2.6.4"
> > I'm gonna try it on a linux distro as I have no experience with it
> running
> > (or setting any nodes up), so I'm really flying blind.
>
> That looks like a working daemon to me Brian.
>
> Can you connect to it?
>
> >
> > On Fri, Dec 17, 2010 at 9:39 AM, Nigel Kersten 
> wrote:
> >>
> >> On Fri, Dec 17, 2010 at 7:33 AM, Brian LaShomb 
> wrote:
> >> > Thanks Nigel,
> >> > I deleted the /etc/puppet and /var/lib/puppet directories and then
> >> > recreated
> >> > the /var/lib/puppet directory with puppet user/group ownership. I then
> >> > reran
> >> > the package installers. No more rrd error. But it still hangs on the
> >> > "Finishing Transaction" line. I had already created the puppet user
> and
> >> > group ahead of time.
> >> > Thought I might need to create that site.pp manifest again, so I did
> the
> >> > same and reran puppetmasterd, still hangs in the same place.
> >>
> >> Are you sure it's actually hung rather than just running as a daemon?
> >>
> >> Can nodes connect to it and do things?
> >>
> >> I won't be online for a little while, but if you should be able to get
> >> a hand on our IRC channel #puppet
> >>
> >> http://projects.puppetlabs.com/projects/puppet/wiki/Irc_Channel
> >>
> >>
> >>
> >> >
> >> >
> >> >
> >> >
> >> > On Thu, Dec 16, 2010 at 6:02 PM, Nigel Kersten 
> >> > wrote:
> >> >>
> >> >> On Thu, Dec 16, 2010 at 1:40 PM, Brian LaShomb 
> >> >> wrote:
> >> >> > Hi all... finally getting around to trying Puppet, I'm excited to
> get
> >> >> > started, but I'm stuck on install. My server a 3-month old Xserve
> >> >> > with
> >> >> > 6GB
> >> >> > of RAM. Didn't configure any other services for it yet, and I tried
> >> >> > installing puppet and facter 3 different ways (because I thought
> the
> >> >> > missing
> >> >> > rrd directory could've been an install glitch).
> >> >> > First I tried downloading from puppetlabs.com and using 'ruby
> >> >> > install'.
> >> >> > Second, I tried the packages for OS X (linked to from Puppet's
> site).
> >> >> > Third
> >> >> > I tried 'gem install'.
> >> >> > After install, I create a file called site.pp at
> >> >> > /etc/puppet/manifests
> >> >> > with
> >> >> > the following. I change this file to puppet user and group
> >> >> > permissions.
> >> >> >
> >> >> > file { "/etc/passwd": owner => "root",
> >> >> >
> >> >> > group => "bin", mode => 644,
> >> >> >
> >> >> > }
> >> >> >
> >> >> > Then I start puppet using:   sudo puppetmasterd --verbose --debug
> >> >> > --no-daemonize
> >> >> > The end of the output shows:
> >> >> > err: /File[/var/lib/puppet/rrd]/ensure: change from absent to
> >> >> > directory
> >> >> > failed: Could not set 'directory on ensure: Permission denied -
> >> >> > /var/lib/puppet/rrd
> >> >> > debug: Finishing transaction 2165906120
> >> >> > Could not run: Got 1 failure(s) while initializing: change from
> >> >> > absent
> >> >> > to
> >> >> > directory failed: Could not set 'directory on ensure: Permission
> >> >> > denied
> >> >> > -
> >> >> > /var/lib/puppet/rrd
> >> >>
> >> >> There's a bug we fixed in the package creation script.
> >> >>
> >> >> We didn't create /var/lib/puppet ahead of 

[Puppet Users] Priority of collection entries

2010-12-17 Thread rjl
Hi all,
I am creating (or allowing creation) of collections of servers on
which to perform some action. Does anyone have any suggestion as to
how to set priority if a server is contained in one or more
collections.

I could write a ruby script to handle this but I was wonder if there
is any 'typical' way of handling this in puppet.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] if then statement within file resource

2010-12-17 Thread CraftyTech
That worked out Wondering why it didn't inside the file resource...  but 
it the workaround is certainly is "legit" enough

Thanks,


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] if then statement within file resource

2010-12-17 Thread Eric Sorenson

On Dec 17, 2010, at 12:51 PM, CraftyTech wrote:

> I'm not able to do an if/then statement within a file resource 
> declaration.  I'm basically trying to distinguish between OS release, so that 
> I can assign an appropriate template.  This is what I have:

Yes the language tutorial on conditionals explains this.  You can use a 
selector inside the resource or the if/else syntax outside the resource to set 
a variable. Selector is less nice because you can't do the numeric comparison, 
you have to fake it with a regexp.

ie.

file {"/etc/sudoers":
 content => $operatingsystemrelease ?
 /^5.[01234]/ => template("system/sudoers_V54.erb"),
 default => template("system/sudeors.erb")
 }

or as other people described, move your if/else outside the resource to set a 
local variable that you then expand.


 - Eric Sorenson - N37 17.255 W121 55.738  - http://twitter.com/ahpook  -

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] if then statement within file resource

2010-12-17 Thread Mark Stanislav
What about just doing:

if ($operatingsystemrelease <= 5.4) {
$sudo_template = "system/sudoers_V54.erb"
} else {
$sudo_template = "system/sudoers.erb"
}

class basic_dev::files {
file { "/etc/sudoers":
owner => root,
group => root,
mode => 0440,
content => template($sudo_template),
backup => ".bak"
   }

Seems legit at least ;)

On Dec 17, 2010, at 3:51 PM, CraftyTech wrote:

> Hello All,
> 
>  I'm not able to do an if/then statement within a file resource 
> declaration.  I'm basically trying to distinguish between OS release, so that 
> I can assign an appropriate template.  This is what I have:
> 
> class basic_dev::files {
> file { "/etc/sudoers":
> owner => root,
> group => root,
> mode => 0440,
> if $operatingsystemrelease <= 5.4 then {
> content => template("system/sudoers_V54.erb")},
> else {
> content => template("system/sudoers.erb")},
>backup => ".bak"
>}
> For some reason is not working.  I keep on getting error: "Could not retrieve 
> catalog from remote server: Error 400 on SERVER: Syntax error at 'if'; 
> expected '}' "
> 
> Any ideas?
> 
> Thanks,
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@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.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] if then statement within file resource

2010-12-17 Thread Disconnect
You can do it magically with source, not sure about template though.
 source =>
["puppet:///system/sudoers_$operatingsysstemrelease","puppet:///system/sudoers"]
(it will look for them in order. We have several that go hostname,
$lsbdistcodename, generic.)

If it doesn't work for template, you can do it the hard way:

  if $operatingsystemrelease <= 5.4 {
file { "/etc/sudoers":etc
  } else {
file { "/etc/sudoers":.
  }

On Fri, Dec 17, 2010 at 3:51 PM, CraftyTech  wrote:

> Hello All,
>
>  I'm not able to do an if/then statement within a file resource
> declaration.  I'm basically trying to distinguish between OS release, so
> that I can assign an appropriate template.  This is what I have:
>
> class basic_dev::files {
> file { "/etc/sudoers":
> owner => root,
> group => root,
> mode => 0440,
> if $operatingsystemrelease <= 5.4 then {
> content => template("system/sudoers_V54.erb")},
> else {
> content => template("system/sudoers.erb")},
>backup => ".bak"
>}
> For some reason is not working.  I keep on getting error: "Could not
> retrieve catalog from remote server: Error 400 on SERVER: Syntax error at
> 'if'; expected '}' "
>
> Any ideas?
>
> Thanks,
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@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.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] if then statement within file resource

2010-12-17 Thread CraftyTech
Hello All,

 I'm not able to do an if/then statement within a file resource 
declaration.  I'm basically trying to distinguish between OS release, so 
that I can assign an appropriate template.  This is what I have:

class basic_dev::files {
file { "/etc/sudoers":
owner => root,
group => root,
mode => 0440,
if $operatingsystemrelease <= 5.4 then {
content => template("system/sudoers_V54.erb")},
else {
content => template("system/sudoers.erb")},
   backup => ".bak"
   }
For some reason is not working.  I keep on getting error: "Could not 
retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 
'if'; expected '}' "

Any ideas?

Thanks,


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] bootstrapping puppetmaster on passenger / syntax ideas

2010-12-17 Thread Adam Heinz
I've been working on a puppet module to bootstrap a 0.25.5
puppetmaster based on these instructions:

http://projects.puppetlabs.com/projects/1/wiki/Using_Passenger

There is a point in the installation where you need to start
/etc/init.d/puppetmaster to get it to generate the necessary .pem
files, then stop it to free up the port.  In my mind's eye, the ideal
syntax looks something like this:

        service { "httpd":
            requires => [
                File["/var/lib/puppet/ssl/certs/ca.pem"],
                File["/var/lib/puppet/ssl/certs/$hostname.$domain.pem"],
                ...
            ],
            ...
        }

        exec { "Create pem files":
            command => [
                "/etc/init.d/puppetmaster start",
                "/etc/init.d/puppetmaster stop",
            ],
            creates => [
                File["/var/lib/puppet/ssl/certs/ca.pem"],
                File["/var/lib/puppet/ssl/certs/$hostname.$domain.pem"],
                ...
            ],
            requires => Package["puppet-server"],
        }

In reality, I end up writing something more like this:

        service { "httpd":
            ...
        }

        exec { "Create pem files (start)":
            command => "/etc/init.d/puppetmaster start",
            notify => Exec["Create pem files (stop)"],
            requires => Package["puppet-server"],
            unless => "test -f /var/lib/puppet/ssl/certs/$hostname.$domain.pem":
        }

        exec { "Create pem files (stop)":
            command => "/etc/init.d/puppetmaster stop",
            notify => Service["httpd"],
            refreshonly => true,
            requires => Package["puppet-server"],
        }

Opinions on this hypothetical syntax?

creates => File
command => array
/etc/init.d/puppetmaster restop ;)

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] Recent (unfun) experience with cron resource on Solaris 10 with puppet 0.25.5

2010-12-17 Thread Bryan Horstmann-Allen
+--
| On 2010-12-17 10:38:54, Don Jackson wrote:
| 
| I was attempting to set up some cron jobs via puppet.
|
| I was trying to get cron to mail the output of the cron jobs to a specific 
user, so I was 
| attempting to set mailto=u...@example.com, via the environment => specifier.
| 
| Puppet did as it was told.
| 
| Unfortunately, I guess that Solaris 10 does not support setting of 
environment variables in crontab files (directly), so
| when puppet attempted to install the generated crontab, the "crontab install 
command" failed, and without an error or warning.

Solaris cron is pretty awful. I would suggest using rjbs's cronjob[1] command
(App::cronjob on the CPAN) to wrap your commands. It does many useful things
and makes cron on Solaris not entirely hateful.

| Also, FYI, I guess Solaris 10 doesn't support the MAILTO env variable anyway, 
so that is my problem.
| 
| I changed my manifest, and all is working now, but 
| 
|   a) wanted to document this on the mailing list in case someone else 
goes down this path
|   b) this might be a bug in the solaris10 cron implementation of puppet?.

Solaris cron itself is a bug. It's just old, and gets no love. (Replacing it
proved to be so onerous rjbs wrote the aforementioned cronjob.)

Well... it's gotten some love in illumos, which now supports MAILTO and various
other things you seen in modern cron. But that isn't going to help those of us
running Solaris 10. :-)

[1] http://advent.rjbs.manxome.org/2009/2009-12-07.html
-- 
bdha
cyberpunk is dead. long live cyberpunk.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] Help with Puppet install on OS X Server

2010-12-17 Thread Nigel Kersten
On Fri, Dec 17, 2010 at 9:02 AM, Brian LaShomb  wrote:
> Nan, MacPorts ended up the same.
> This is where it ends up...
> https://img.skitch.com/20101217-c2jbed6q8psp6r8yqr3gfd8ayr.jpg
> When I run it without debug, the last line output is "notice: Starting
> Puppet master version 2.6.4"
> I'm gonna try it on a linux distro as I have no experience with it running
> (or setting any nodes up), so I'm really flying blind.

That looks like a working daemon to me Brian.

Can you connect to it?

>
> On Fri, Dec 17, 2010 at 9:39 AM, Nigel Kersten  wrote:
>>
>> On Fri, Dec 17, 2010 at 7:33 AM, Brian LaShomb  wrote:
>> > Thanks Nigel,
>> > I deleted the /etc/puppet and /var/lib/puppet directories and then
>> > recreated
>> > the /var/lib/puppet directory with puppet user/group ownership. I then
>> > reran
>> > the package installers. No more rrd error. But it still hangs on the
>> > "Finishing Transaction" line. I had already created the puppet user and
>> > group ahead of time.
>> > Thought I might need to create that site.pp manifest again, so I did the
>> > same and reran puppetmasterd, still hangs in the same place.
>>
>> Are you sure it's actually hung rather than just running as a daemon?
>>
>> Can nodes connect to it and do things?
>>
>> I won't be online for a little while, but if you should be able to get
>> a hand on our IRC channel #puppet
>>
>> http://projects.puppetlabs.com/projects/puppet/wiki/Irc_Channel
>>
>>
>>
>> >
>> >
>> >
>> >
>> > On Thu, Dec 16, 2010 at 6:02 PM, Nigel Kersten 
>> > wrote:
>> >>
>> >> On Thu, Dec 16, 2010 at 1:40 PM, Brian LaShomb 
>> >> wrote:
>> >> > Hi all... finally getting around to trying Puppet, I'm excited to get
>> >> > started, but I'm stuck on install. My server a 3-month old Xserve
>> >> > with
>> >> > 6GB
>> >> > of RAM. Didn't configure any other services for it yet, and I tried
>> >> > installing puppet and facter 3 different ways (because I thought the
>> >> > missing
>> >> > rrd directory could've been an install glitch).
>> >> > First I tried downloading from puppetlabs.com and using 'ruby
>> >> > install'.
>> >> > Second, I tried the packages for OS X (linked to from Puppet's site).
>> >> > Third
>> >> > I tried 'gem install'.
>> >> > After install, I create a file called site.pp at
>> >> > /etc/puppet/manifests
>> >> > with
>> >> > the following. I change this file to puppet user and group
>> >> > permissions.
>> >> >
>> >> > file { "/etc/passwd": owner => "root",
>> >> >
>> >> > group => "bin", mode => 644,
>> >> >
>> >> > }
>> >> >
>> >> > Then I start puppet using:   sudo puppetmasterd --verbose --debug
>> >> > --no-daemonize
>> >> > The end of the output shows:
>> >> > err: /File[/var/lib/puppet/rrd]/ensure: change from absent to
>> >> > directory
>> >> > failed: Could not set 'directory on ensure: Permission denied -
>> >> > /var/lib/puppet/rrd
>> >> > debug: Finishing transaction 2165906120
>> >> > Could not run: Got 1 failure(s) while initializing: change from
>> >> > absent
>> >> > to
>> >> > directory failed: Could not set 'directory on ensure: Permission
>> >> > denied
>> >> > -
>> >> > /var/lib/puppet/rrd
>> >>
>> >> There's a bug we fixed in the package creation script.
>> >>
>> >> We didn't create /var/lib/puppet ahead of time, so creating
>> >> /var/lib/puppet/rrd fails.
>> >>
>> >> Create /var/lib/puppet and it should all be good.
>> >>
>> >> Note that the other big bug is that --mkusers doesn't work. There is a
>> >> patch in, but no release that includes it yet.
>> >>
>> >> You can create the puppet user/group by hand.
>> >>
>> >>
>> >>
>> >> >
>> >> > I have no rrd directory... here is what I have.
>> >> > server:~ admin$ ls -al /var/lib/puppet/
>> >> > total 0
>> >&g

[Puppet Users] Recent (unfun) experience with cron resource on Solaris 10 with puppet 0.25.5

2010-12-17 Thread Don Jackson

I was attempting to set up some cron jobs via puppet.

I was trying to get cron to mail the output of the cron jobs to a specific 
user, so I was 
attempting to set mailto=u...@example.com, via the environment => specifier.

Puppet did as it was told.

Unfortunately, I guess that Solaris 10 does not support setting of environment 
variables in crontab files (directly), so
when puppet attempted to install the generated crontab, the "crontab install 
command" failed, and without an error or warning.

It took some painful hand experimentation to figure out the problem.

Also, FYI, I guess Solaris 10 doesn't support the MAILTO env variable anyway, 
so that is my problem.

I changed my manifest, and all is working now, but 

a) wanted to document this on the mailing list in case someone else 
goes down this path
b) this might be a bug in the solaris10 cron implementation of puppet….

Don

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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: exec prior to changes

2010-12-17 Thread CraftyTech
Thanks Nan... It really helped out a lot.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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: Referencing the same package from multiple classes

2010-12-17 Thread bluebook
Thanks everyone for the pointers.  I've gone with the Virtual
Resources approach because (a) the description of them more or less
exactly matches my use case, and (b) because from a class perspective
I'm trying to follow the "is a web server" type of paradigm, and "is a
jre-jce" doesn't really work in that context - it's too granular, and
not a description of the role of the node.

Paul

On Dec 17, 4:32 pm, Stefan Schulte 
wrote:
> On Fri, Dec 17, 2010 at 07:46:29AM -0800, luke.bigum wrote:
> > Nigel's Virtual Resources is one way, this is another using only
> > classes.
>
> > You can put the base software in classes of their own and include
> > these in your 'server classes'. Classes can be included multiple times
> > on a node without causing errors.
>
> Hm personally, I don't really like that because you can include the class in
> different scopes:
>
> One example:
>
>   class common {
>     file { '/tmp/test':
>       content => $tempvar,
>       ensure  => file,
>     }
>   }
>   class foo {
>     $tempvar = "foo"
>     include common
>   }
>   class bar {
>     $tempvar = "bar"
>     include common
>   }
>   node default {
>     include foo
>     include bar
>   }
>
> This does not throw a compile error but it really depends on ordering if
> "foo" or "bar" will be in your file. If you define a virtual resource in
> one place then everything depends on the scope where you defined that
> resource and not where you realize it.
>
> -Stefan
>
>  application_pgp-signature_part
> < 1KViewDownload

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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-dev] Re: [Puppet Users] What am I doing wrong?

2010-12-17 Thread Umair Ghani
this works...thanks again..

Umair

On Fri, Dec 17, 2010 at 10:12 AM, Stefan Schulte <
stefan.schu...@taunusstein.net> wrote:

> On Thu, Dec 16, 2010 at 06:34:53PM -0600, Umair Ghani wrote:
> > One more question. How can I run hostmanager as a particular user? By
> > default it runs it as user root.
> >
> > Thanks
> > Umair
>
> I never used that one but puppet has a util function for that purpose
> (asuser defined in util/suidmanager.rb). This SHOULD work:
>
>  Puppet::Util::SUIDManager.asuser(myuid, mygid) do
> hostmanager '-s', @resource[:name],
>  '-r', @resource[:release], '--install'
>   end
>
> You should also test @resource[:release].nil? because the user might not
> provide every parameter. Or you should define a default value.
>
> -Stefan
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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: Referencing the same package from multiple classes

2010-12-17 Thread luke.bigum
That's a fair point, but I shy away from using variables in one class
to influence another as much as possible for two reasons. First is
Puppet's variable scope is confusing at best. Second is I like to have
my classes do actions on a specific bit of a system entirely within
themselves, so anything that does anything with, say, Apache is in an
Apache class and any other class that wants to do something with
Apache has to use the Apache class's defines or sub classes to achieve
that functionality. This doesn't always work out but I try stick to it
as much as possible.

If I had to do something like your example, I would use sub classes of
common that work slightly differently based on the functionality I
want. If that wasn't practical I'd look at trying to achieve the same
thing with a define. This won't work for this exact example as trying
to fill the same file with two different contents is not the smartest
idea, but just to stay on subject I would try to do something like:

#either using a child class
class common {
  file { '/tmp/test':
content => "default",
ensure  => file,
  }
}
class common::foo inherits common {
  File['/tmp/test'] { content => "foo content" }
}
class foo {
  include common::foo
}

#or Using a define
class bar {
  include common
  common_file{"something": contents => "bar content" }
}

... but as I said, including both foo and bar on a node in this exact
example would cause compile problems, but hopefully it illustrates my
idea :)

On Dec 17, 4:32 pm, Stefan Schulte 
wrote:
> On Fri, Dec 17, 2010 at 07:46:29AM -0800, luke.bigum wrote:
> > Nigel's Virtual Resources is one way, this is another using only
> > classes.
>
> > You can put the base software in classes of their own and include
> > these in your 'server classes'. Classes can be included multiple times
> > on a node without causing errors.
>
> Hm personally, I don't really like that because you can include the class in
> different scopes:
>
> One example:
>
>   class common {
>     file { '/tmp/test':
>       content => $tempvar,
>       ensure  => file,
>     }
>   }
>   class foo {
>     $tempvar = "foo"
>     include common
>   }
>   class bar {
>     $tempvar = "bar"
>     include common
>   }
>   node default {
>     include foo
>     include bar
>   }
>
> This does not throw a compile error but it really depends on ordering if
> "foo" or "bar" will be in your file. If you define a virtual resource in
> one place then everything depends on the scope where you defined that
> resource and not where you realize it.
>
> -Stefan
>
>  application_pgp-signature_part
> < 1KViewDownload

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] Help with Puppet install on OS X Server

2010-12-17 Thread Brian LaShomb
Nan, MacPorts ended up the same.

This is where it ends up...
https://img.skitch.com/20101217-c2jbed6q8psp6r8yqr3gfd8ayr.jpg

When I run it without debug, the last line output is "notice: Starting
Puppet master version 2.6.4"

I'm gonna try it on a linux distro as I have no experience with it running
(or setting any nodes up), so I'm really flying blind.


On Fri, Dec 17, 2010 at 9:39 AM, Nigel Kersten  wrote:

> On Fri, Dec 17, 2010 at 7:33 AM, Brian LaShomb  wrote:
> > Thanks Nigel,
> > I deleted the /etc/puppet and /var/lib/puppet directories and then
> recreated
> > the /var/lib/puppet directory with puppet user/group ownership. I then
> reran
> > the package installers. No more rrd error. But it still hangs on the
> > "Finishing Transaction" line. I had already created the puppet user and
> > group ahead of time.
> > Thought I might need to create that site.pp manifest again, so I did the
> > same and reran puppetmasterd, still hangs in the same place.
>
> Are you sure it's actually hung rather than just running as a daemon?
>
> Can nodes connect to it and do things?
>
> I won't be online for a little while, but if you should be able to get
> a hand on our IRC channel #puppet
>
> http://projects.puppetlabs.com/projects/puppet/wiki/Irc_Channel
>
>
>
> >
> >
> >
> >
> > On Thu, Dec 16, 2010 at 6:02 PM, Nigel Kersten 
> wrote:
> >>
> >> On Thu, Dec 16, 2010 at 1:40 PM, Brian LaShomb 
> wrote:
> >> > Hi all... finally getting around to trying Puppet, I'm excited to get
> >> > started, but I'm stuck on install. My server a 3-month old Xserve with
> >> > 6GB
> >> > of RAM. Didn't configure any other services for it yet, and I tried
> >> > installing puppet and facter 3 different ways (because I thought the
> >> > missing
> >> > rrd directory could've been an install glitch).
> >> > First I tried downloading from puppetlabs.com and using 'ruby
> install'.
> >> > Second, I tried the packages for OS X (linked to from Puppet's site).
> >> > Third
> >> > I tried 'gem install'.
> >> > After install, I create a file called site.pp at /etc/puppet/manifests
> >> > with
> >> > the following. I change this file to puppet user and group
> permissions.
> >> >
> >> > file { "/etc/passwd": owner => "root",
> >> >
> >> > group => "bin", mode => 644,
> >> >
> >> > }
> >> >
> >> > Then I start puppet using:   sudo puppetmasterd --verbose --debug
> >> > --no-daemonize
> >> > The end of the output shows:
> >> > err: /File[/var/lib/puppet/rrd]/ensure: change from absent to
> directory
> >> > failed: Could not set 'directory on ensure: Permission denied -
> >> > /var/lib/puppet/rrd
> >> > debug: Finishing transaction 2165906120
> >> > Could not run: Got 1 failure(s) while initializing: change from absent
> >> > to
> >> > directory failed: Could not set 'directory on ensure: Permission
> denied
> >> > -
> >> > /var/lib/puppet/rrd
> >>
> >> There's a bug we fixed in the package creation script.
> >>
> >> We didn't create /var/lib/puppet ahead of time, so creating
> >> /var/lib/puppet/rrd fails.
> >>
> >> Create /var/lib/puppet and it should all be good.
> >>
> >> Note that the other big bug is that --mkusers doesn't work. There is a
> >> patch in, but no release that includes it yet.
> >>
> >> You can create the puppet user/group by hand.
> >>
> >>
> >>
> >> >
> >> > I have no rrd directory... here is what I have.
> >> > server:~ admin$ ls -al /var/lib/puppet/
> >> > total 0
> >> > drwxr-xr-x  11 rootwheel   374 Dec 16 14:31 .
> >> > drwxr-xr-x   4 rootwheel   136 Dec 16 14:31 ..
> >> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 bucket
> >> > drwxr-xr-x   2 rootwheel68 Dec 16 14:31 facts
> >> > drwxr-xr-x   2 rootwheel68 Dec 16 14:31 lib
> >> > drwxr-x---   3 puppet  puppet  102 Dec 16 14:31 log
> >> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 reports
> >> > drwxrwxrwt   3 rootwheel   102 Dec 16 14:31 run
> >> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 server_data
> >> > drwxr-xr-t   2 rootwh

Re: [Puppet Users] puppetmaster 100%cpu usage on 2.6 (not on 0.24)

2010-12-17 Thread Ashley Penney
As a datapoint, I experience this problem on RHEL6:

ruby-1.8.7.299-4.el6.x86_64

Gems:

passenger (3.0.0)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
rails (3.0.3)

On Fri, Dec 17, 2010 at 11:27 AM, Leonid Batizhevsky
wrote:

> Ruby or puppet?
> I start use from 0.25.x (from epel repo and not long) and  1.8.5 ruby.
> Then I update to 2.6.0 and I saw memory problems.
> I start to google and found:
> http://projects.puppetlabs.com/projects/1/wiki/Puppet_Red_Hat_Centos
> "The 1.8.5 branch of Ruby shipped will RHEL5 can exhibit memory leaks. "
> And upgrade to ruby enterprise 1.8.7 and It solve my problems!
>
> Leonid S. Batizhevsky
>
>
>
>
>
> On Fri, Dec 17, 2010 at 03:03, Nigel Kersten  wrote:
> > For the sake of the archives, what version did you upgrade *from* Leonid
> ?
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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: Referencing the same package from multiple classes

2010-12-17 Thread Stefan Schulte
On Fri, Dec 17, 2010 at 07:46:29AM -0800, luke.bigum wrote:
> Nigel's Virtual Resources is one way, this is another using only
> classes.
> 
> You can put the base software in classes of their own and include
> these in your 'server classes'. Classes can be included multiple times
> on a node without causing errors.

Hm personally, I don't really like that because you can include the class in
different scopes:

One example:

  class common {
file { '/tmp/test':
  content => $tempvar,
  ensure  => file,
}
  }
  class foo {
$tempvar = "foo"
include common
  }
  class bar {
$tempvar = "bar"
include common
  }
  node default {
include foo
include bar
  }

This does not throw a compile error but it really depends on ordering if
"foo" or "bar" will be in your file. If you define a virtual resource in
one place then everything depends on the scope where you defined that
resource and not where you realize it.

-Stefan


pgp2WhnCwHqgE.pgp
Description: PGP signature


Re: [Puppet Users] puppetmaster 100%cpu usage on 2.6 (not on 0.24)

2010-12-17 Thread Leonid Batizhevsky
Ruby or puppet?
I start use from 0.25.x (from epel repo and not long) and  1.8.5 ruby.
Then I update to 2.6.0 and I saw memory problems.
I start to google and found:
http://projects.puppetlabs.com/projects/1/wiki/Puppet_Red_Hat_Centos
"The 1.8.5 branch of Ruby shipped will RHEL5 can exhibit memory leaks. "
And upgrade to ruby enterprise 1.8.7 and It solve my problems!

Leonid S. Batizhevsky





On Fri, Dec 17, 2010 at 03:03, Nigel Kersten  wrote:
> For the sake of the archives, what version did you upgrade *from* Leonid ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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: exec prior to changes

2010-12-17 Thread Nan Liu
On Fri, Dec 17, 2010 at 8:20 AM, CraftyTech  wrote:
> I spoke too quickly...  It executes on refresh, but it still does it after
> the changes, and not before, which kind of defeats the purpose of my backup
> script... If someone else has a suggestion, I'd happy to hear it..
> Thanks,

This doesn't execute the exec first, but will allow you to backup of
the file in a round about way. In the file resource configure backup
=> ".bak",  then notice the exec against the .bak file.

Thanks,

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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-dev] Re: [Puppet Users] What am I doing wrong?

2010-12-17 Thread Stefan Schulte
On Thu, Dec 16, 2010 at 06:34:53PM -0600, Umair Ghani wrote:
> One more question. How can I run hostmanager as a particular user? By
> default it runs it as user root.
> 
> Thanks
> Umair

I never used that one but puppet has a util function for that purpose
(asuser defined in util/suidmanager.rb). This SHOULD work:

  Puppet::Util::SUIDManager.asuser(myuid, mygid) do
hostmanager '-s', @resource[:name],
  '-r', @resource[:release], '--install'
  end

You should also test @resource[:release].nil? because the user might not
provide every parameter. Or you should define a default value.

-Stefan


pgpVk0VWlm0W2.pgp
Description: PGP signature


[Puppet Users] Re: Referencing the same package from multiple classes

2010-12-17 Thread luke.bigum
Nigel's Virtual Resources is one way, this is another using only
classes.

You can put the base software in classes of their own and include
these in your 'server classes'. Classes can be included multiple times
on a node without causing errors.

You'll want something that looks like:

class jre-jce {
  package { "jre-jce": ... }
}

class tomcat {
  package { "tomcat: ... }
}

class foo {
  include jre-jce
  include tomcat
  ... (do more stuff) ...
}

class bar {
  include jre-jce
  include tomcat
  ... (do more stuff) ...
}

node something {
  include foo
  include bar
}

If inside classes foo and bar you need to make sure that things occur
after jre-jce is installed you can setup a dependency with require,
see: http://docs.puppetlabs.com/references/latest/metaparameter.html#require

This is more verbose than using virtual resources, but the I like the
advantage that you've now already got a place where you can  put site
wide configuration for tomcat or jre-jce.

On Dec 17, 3:17 pm, bluebook  wrote:
> Hello,
>
> I'm new to puppet, so maybe this is a silly question, but an hour of
> googling has thrown up nothing.
>
> I am trying to define a set of classes which each represent different
> server types in my architecture, for example "dns server" and "web
> server".  A single machine may perform more than one server role - eg
> it could be both a dns server and a web server.
>
> For the types of roles I have, lets call them foo and bar, there are
> some packages in common.  Eg they both require tomcat and jre.  So to
> start off with I tried this:
>
> class foo {
>   package { jre-jce:                  ensure => present}
>   package { tomcat:               ensure => '6.0.20-1'}
>   package { foo-services:     ensure => present}
>
> }
>
> class bar {
>   package { jre-jce:                  ensure => present}
>   package { tomcat:               ensure => '6.0.20-1'}
>   package { bar-services:     ensure => present}
>
> }
>
> node 'server1' {
>         include foo
>         include bar
>
> }
>
> This works fine if I only include one class or the other in the node
> definition, but if I include both then I get an error "Package[jre-
> jce] is already defined in file ...; cannot redefine at ..."
>
> So now I am trying to find a way to move the package definitions
> outside of the class definitions, and reference them from there.  But
> I can't find a syntax which allows me to do that.  The closest I have
> come is this:
>
> package { jre-jce:                  ensure => present}
>
> class foo {
>   Package["jre-jce"] {}
>
> }
>
> but puppet doesn't like the empty braces.
>
> Is there a better way to do what I am trying to do?  Or is this the
> right way but the wrong syntax?
>
> Thanks for any help.
>
> Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] Help with Puppet install on OS X Server

2010-12-17 Thread Nigel Kersten
On Fri, Dec 17, 2010 at 7:33 AM, Brian LaShomb  wrote:
> Thanks Nigel,
> I deleted the /etc/puppet and /var/lib/puppet directories and then recreated
> the /var/lib/puppet directory with puppet user/group ownership. I then reran
> the package installers. No more rrd error. But it still hangs on the
> "Finishing Transaction" line. I had already created the puppet user and
> group ahead of time.
> Thought I might need to create that site.pp manifest again, so I did the
> same and reran puppetmasterd, still hangs in the same place.

Are you sure it's actually hung rather than just running as a daemon?

Can nodes connect to it and do things?

I won't be online for a little while, but if you should be able to get
a hand on our IRC channel #puppet

http://projects.puppetlabs.com/projects/puppet/wiki/Irc_Channel



>
>
>
>
> On Thu, Dec 16, 2010 at 6:02 PM, Nigel Kersten  wrote:
>>
>> On Thu, Dec 16, 2010 at 1:40 PM, Brian LaShomb  wrote:
>> > Hi all... finally getting around to trying Puppet, I'm excited to get
>> > started, but I'm stuck on install. My server a 3-month old Xserve with
>> > 6GB
>> > of RAM. Didn't configure any other services for it yet, and I tried
>> > installing puppet and facter 3 different ways (because I thought the
>> > missing
>> > rrd directory could've been an install glitch).
>> > First I tried downloading from puppetlabs.com and using 'ruby install'.
>> > Second, I tried the packages for OS X (linked to from Puppet's site).
>> > Third
>> > I tried 'gem install'.
>> > After install, I create a file called site.pp at /etc/puppet/manifests
>> > with
>> > the following. I change this file to puppet user and group permissions.
>> >
>> > file { "/etc/passwd": owner => "root",
>> >
>> > group => "bin", mode => 644,
>> >
>> > }
>> >
>> > Then I start puppet using:   sudo puppetmasterd --verbose --debug
>> > --no-daemonize
>> > The end of the output shows:
>> > err: /File[/var/lib/puppet/rrd]/ensure: change from absent to directory
>> > failed: Could not set 'directory on ensure: Permission denied -
>> > /var/lib/puppet/rrd
>> > debug: Finishing transaction 2165906120
>> > Could not run: Got 1 failure(s) while initializing: change from absent
>> > to
>> > directory failed: Could not set 'directory on ensure: Permission denied
>> > -
>> > /var/lib/puppet/rrd
>>
>> There's a bug we fixed in the package creation script.
>>
>> We didn't create /var/lib/puppet ahead of time, so creating
>> /var/lib/puppet/rrd fails.
>>
>> Create /var/lib/puppet and it should all be good.
>>
>> Note that the other big bug is that --mkusers doesn't work. There is a
>> patch in, but no release that includes it yet.
>>
>> You can create the puppet user/group by hand.
>>
>>
>>
>> >
>> > I have no rrd directory... here is what I have.
>> > server:~ admin$ ls -al /var/lib/puppet/
>> > total 0
>> > drwxr-xr-x  11 root    wheel   374 Dec 16 14:31 .
>> > drwxr-xr-x   4 root    wheel   136 Dec 16 14:31 ..
>> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 bucket
>> > drwxr-xr-x   2 root    wheel    68 Dec 16 14:31 facts
>> > drwxr-xr-x   2 root    wheel    68 Dec 16 14:31 lib
>> > drwxr-x---   3 puppet  puppet  102 Dec 16 14:31 log
>> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 reports
>> > drwxrwxrwt   3 root    wheel   102 Dec 16 14:31 run
>> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 server_data
>> > drwxr-xr-t   2 root    wheel    68 Dec 16 14:31 state
>> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 yaml
>> >
>> > From here I've tried creating the rrd directory and applying user and
>> > group
>> > permissions to puppet, but it just hangs with the following output when
>> > rerunning the aforementioned puppetmasterd command.
>> > notice: Starting Puppet master version 2.6.4
>> > debug: No file server configuration file; autocreating modules mount
>> > with
>> > default permissions
>> > debug: No file server configuration file; autocreating plugins mount
>> > with
>> > default permissions
>> > debug: Finishing transaction 2165520200
>> >
>> > What am I missing? Thanks for the help... I can't wait to start using
>> > Puppet!
>> >
>> > -Brian
>> >
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Puppet Users" group.
>> > To post to this group, send email to puppet-us...@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.
>> >
>>
>>
>>
>> --
>> Nigel Kersten - Puppet Labs -  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-us...@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.
>>
>
> --
> You recei

Re: [Puppet Users] Help with Puppet install on OS X Server

2010-12-17 Thread Brian LaShomb
Thanks Nigel,

I deleted the /etc/puppet and /var/lib/puppet directories and then recreated
the /var/lib/puppet directory with puppet user/group ownership. I then reran
the package installers. No more rrd error. But it still hangs on the
"Finishing Transaction" line. I had already created the puppet user and
group ahead of time.

Thought I might need to create that site.pp manifest again, so I did the
same and reran puppetmasterd, still hangs in the same place.





On Thu, Dec 16, 2010 at 6:02 PM, Nigel Kersten  wrote:

> On Thu, Dec 16, 2010 at 1:40 PM, Brian LaShomb  wrote:
> > Hi all... finally getting around to trying Puppet, I'm excited to get
> > started, but I'm stuck on install. My server a 3-month old Xserve with
> 6GB
> > of RAM. Didn't configure any other services for it yet, and I tried
> > installing puppet and facter 3 different ways (because I thought the
> missing
> > rrd directory could've been an install glitch).
> > First I tried downloading from puppetlabs.com and using 'ruby install'.
> > Second, I tried the packages for OS X (linked to from Puppet's site).
> Third
> > I tried 'gem install'.
> > After install, I create a file called site.pp at /etc/puppet/manifests
> with
> > the following. I change this file to puppet user and group permissions.
> >
> > file { "/etc/passwd": owner => "root",
> >
> > group => "bin", mode => 644,
> >
> > }
> >
> > Then I start puppet using:   sudo puppetmasterd --verbose --debug
> > --no-daemonize
> > The end of the output shows:
> > err: /File[/var/lib/puppet/rrd]/ensure: change from absent to directory
> > failed: Could not set 'directory on ensure: Permission denied -
> > /var/lib/puppet/rrd
> > debug: Finishing transaction 2165906120
> > Could not run: Got 1 failure(s) while initializing: change from absent to
> > directory failed: Could not set 'directory on ensure: Permission denied -
> > /var/lib/puppet/rrd
>
> There's a bug we fixed in the package creation script.
>
> We didn't create /var/lib/puppet ahead of time, so creating
> /var/lib/puppet/rrd fails.
>
> Create /var/lib/puppet and it should all be good.
>
> Note that the other big bug is that --mkusers doesn't work. There is a
> patch in, but no release that includes it yet.
>
> You can create the puppet user/group by hand.
>
>
>
> >
> > I have no rrd directory... here is what I have.
> > server:~ admin$ ls -al /var/lib/puppet/
> > total 0
> > drwxr-xr-x  11 rootwheel   374 Dec 16 14:31 .
> > drwxr-xr-x   4 rootwheel   136 Dec 16 14:31 ..
> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 bucket
> > drwxr-xr-x   2 rootwheel68 Dec 16 14:31 facts
> > drwxr-xr-x   2 rootwheel68 Dec 16 14:31 lib
> > drwxr-x---   3 puppet  puppet  102 Dec 16 14:31 log
> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 reports
> > drwxrwxrwt   3 rootwheel   102 Dec 16 14:31 run
> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 server_data
> > drwxr-xr-t   2 rootwheel68 Dec 16 14:31 state
> > drwxr-x---   2 puppet  puppet   68 Dec 16 14:31 yaml
> >
> > From here I've tried creating the rrd directory and applying user and
> group
> > permissions to puppet, but it just hangs with the following output when
> > rerunning the aforementioned puppetmasterd command.
> > notice: Starting Puppet master version 2.6.4
> > debug: No file server configuration file; autocreating modules mount with
> > default permissions
> > debug: No file server configuration file; autocreating plugins mount with
> > default permissions
> > debug: Finishing transaction 2165520200
> >
> > What am I missing? Thanks for the help... I can't wait to start using
> > Puppet!
> >
> > -Brian
> >
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Puppet Users" group.
> > To post to this group, send email to puppet-us...@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.
> >
>
>
>
> --
> Nigel Kersten - Puppet Labs -  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-us...@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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] Referencing the same package from multiple classes

2010-12-17 Thread Nigel Kersten
On Fri, Dec 17, 2010 at 7:17 AM, bluebook  wrote:
> Hello,
>
> I'm new to puppet, so maybe this is a silly question, but an hour of
> googling has thrown up nothing.
>
> I am trying to define a set of classes which each represent different
> server types in my architecture, for example "dns server" and "web
> server".  A single machine may perform more than one server role - eg
> it could be both a dns server and a web server.
>
> For the types of roles I have, lets call them foo and bar, there are
> some packages in common.  Eg they both require tomcat and jre.  So to
> start off with I tried this:
>
> class foo {
>  package { jre-jce:                  ensure => present}
>  package { tomcat:               ensure => '6.0.20-1'}
>  package { foo-services:     ensure => present}
> }
>
> class bar {
>  package { jre-jce:                  ensure => present}
>  package { tomcat:               ensure => '6.0.20-1'}
>  package { bar-services:     ensure => present}
> }
>
> node 'server1' {
>        include foo
>        include bar
> }
>
> This works fine if I only include one class or the other in the node
> definition, but if I include both then I get an error "Package[jre-
> jce] is already defined in file ...; cannot redefine at ..."


http://projects.puppetlabs.com/projects/1/wiki/Virtual_Resources

Define the virtual resource outside the classes, realize it in both.

>
> So now I am trying to find a way to move the package definitions
> outside of the class definitions, and reference them from there.  But
> I can't find a syntax which allows me to do that.  The closest I have
> come is this:
>
> package { jre-jce:                  ensure => present}
>
> class foo {
>  Package["jre-jce"] {}
> }
>
> but puppet doesn't like the empty braces.
>
> Is there a better way to do what I am trying to do?  Or is this the
> right way but the wrong syntax?
>
> Thanks for any help.
>
> Paul
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@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.
>
>



-- 
Nigel Kersten - Puppet Labs -  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-us...@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: exec prior to changes

2010-12-17 Thread CraftyTech
I spoke too quickly...  It executes on refresh, but it still does it after 
the changes, and not before, which kind of defeats the purpose of my backup 
script... If someone else has a suggestion, I'd happy to hear it..

Thanks,


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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] Referencing the same package from multiple classes

2010-12-17 Thread bluebook
Hello,

I'm new to puppet, so maybe this is a silly question, but an hour of
googling has thrown up nothing.

I am trying to define a set of classes which each represent different
server types in my architecture, for example "dns server" and "web
server".  A single machine may perform more than one server role - eg
it could be both a dns server and a web server.

For the types of roles I have, lets call them foo and bar, there are
some packages in common.  Eg they both require tomcat and jre.  So to
start off with I tried this:

class foo {
  package { jre-jce:  ensure => present}
  package { tomcat:   ensure => '6.0.20-1'}
  package { foo-services: ensure => present}
}

class bar {
  package { jre-jce:  ensure => present}
  package { tomcat:   ensure => '6.0.20-1'}
  package { bar-services: ensure => present}
}

node 'server1' {
include foo
include bar
}

This works fine if I only include one class or the other in the node
definition, but if I include both then I get an error "Package[jre-
jce] is already defined in file ...; cannot redefine at ..."

So now I am trying to find a way to move the package definitions
outside of the class definitions, and reference them from there.  But
I can't find a syntax which allows me to do that.  The closest I have
come is this:

package { jre-jce:  ensure => present}

class foo {
  Package["jre-jce"] {}
}

but puppet doesn't like the empty braces.

Is there a better way to do what I am trying to do?  Or is this the
right way but the wrong syntax?

Thanks for any help.

Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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: exec prior to changes

2010-12-17 Thread Felix Frank
On 12/16/2010 11:31 PM, CraftyTech wrote:
> Answered my own question.  Basically you'd need to use: refreshonly => true.

Yes, but have you gotten puppet to do the exec before it updates the
resource in question? If so, I'd like to know how you did that ;)

Cheers,
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-us...@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] Exec resource doc appears outdated

2010-12-17 Thread Felix Frank
On 12/16/2010 11:16 PM, Lucas Ewalt wrote:
> Hoping someone can shed some light on this.
> 
> In the Puppet resource type doc at 
> http://docs.puppetlabs.com/references/stable/type.html#exec
> it says this about exec:
> 
> "It is worth noting that exec is special, in that it is not currently
> considered an error to have multiple exec instances with the same
> name. This was done purely because it had to be this way in order to
> get certain functionality, but it complicates things. In particular,
> you will not be able to use exec instances that share their commands
> with other instances as a dependency, since Puppet has no way of
> knowing which instance you mean."
> 
> However, trying this in Puppet 2.6.2 results in a duplicate definition
> error, similar to the other resource types.
> 
> I see in the 0.24.2 release notes at
> http://projects.puppetlabs.com/projects/puppet/wiki/Release_Notes#Types+and+Providers:
> 
> "Exec resources must now have unique names, although the commands can
> still be duplicated. This is easily accomplished by just specifying a
> unique name with whatever (unique or otherwise) command you need."
> 
> It sounds like the 'specialness' of Exec has long been removed from
> Puppet.  Has anyone else ran into this?  Are the docs indeed outdated?
> 

There's an obvious discrepancy. You should open a documentation bug.

Cheers,
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-us...@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] Issue upgrading to 2.6.3

2010-12-17 Thread Felix Frank
On 12/16/2010 05:44 PM, Stu Teasdale wrote:
> Hi all,
> 
> I seem to be having an odd issue since upgrading from 0.25.4 to 2.6.3 
> with a template based external file resource. On the clients that 
> define the resource I get the following error:
> 
> err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Failed to parse template backup/backuppc.host.pl: undefined method ach' 
> for :undef:Symbol at 
> 
> This worked fine before.
> 
> Any ideas?

Well, *does* your template contain that string (ach)?
If so, in what context and for what purpose?

Regards,
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-us...@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: n00b questions - verbosity of config????

2010-12-17 Thread Tim Watts

On 17/12/10 05:37, Nan Liu wrote:

On Thu, Dec 16, 2010 at 2:57 PM, Tim Watts  wrote:





Sorry - I don;t understand this - is this pure ruby or puppet language?


Just to indicate it's an optional parameter, since default behavior is
handled as seen below.


   if $mode != "" { File { mode =>$mode } }


If it were ruby, I might have expected File:Stat or whatever - but I can't
find any docs on the puppet site describing "File".


Resource defaults, definitely a clever use:
http://docs.puppetlabs.com/guides/language_tutorial.html#resource-defaults





Thanks Nan.

Tim

--
Tim Watts
Personal Email

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@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.