Re: [Puppet Users] Exec python script on puppet clinet running on windows

2012-10-23 Thread Josh Cooper
Hi Viktoriya,

On Oct 23, 2012, at 8:09 PM, VT  wrote:

> I am trying to execute a python script from manifest file on puppet windows 
> based client:
> 
> exec {'ez_setup.py  -U setuptools':
> 
> #command => 'C:\Python27\ez_setup.py -U setuptools',
> 
> cwd => 'C:\Python27',
> 
> path => 'C:\Python27;%PATH%',
> 
That needs to be:

path => "C:\\Python27;${path}"

Since the catalog is compiled on the master, we need to use the value of the 
agent's path fact. Since we're interpolating, we have to use double quotes, 
which then means we have to escape backslashes.
> #creates => 'C:\Program,
> 
> require => File['C:\Python27'], 
> 
> }
> 
> I have 'file' block as well, which is copies the file first, before 
> execution. However, I am getting following error:
> **
> C:\Program Files\Puppet Labs\Puppet Enterprise\bin>puppet agent --test 
> --server
> qalab2.pertino.com
> info: Retrieving plugin
> err: /File[C:/ProgramData/PuppetLabs/puppet/var/lib]: Could not evaluate: 
> Could
> not retrieve information from environment production source(s) 
> puppet://qalab2.p
> ertino.com/plugins
> info: Caching catalog for homebasic32.pertino.com
> info: Applying configuration version '1351047345'
> err: /Stage[main]//Exec[ez_setup.py  -U setuptools]/returns: change from 
> notrun
> to 0 failed: CreateProcess() failed:
> notice: Finished catalog run in 4.06 seconds

I think that your command needs to be something like:

"python.exe ez_setup.py ..."

The issue is that the windows exec provider calls the Win32 API CreateProcess, 
which may not be able to execute the script directly.

Ideally we'd have a shell provider on Windows, but we haven't implemented one 
yet, e.g. to handle shell builtins like echo, mkdir, etc

Also for general debugging, I recommend running with --debug to show what 
commands each provider is executing.

> **
> I have no idea how to debug. Pls help!
> 
> Great Thanks,
> Viktoriya
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/puppet-users/-/S3z9K-EZwoYJ.
> 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.

Josh

-- 
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] Exec python script on puppet clinet running on windows

2012-10-23 Thread VT
I am trying to execute a python script from manifest file on puppet windows 
based client:

exec {'ez_setup.py  -U setuptools':

#command => 'C:\Python27\ez_setup.py -U setuptools',

cwd => 'C:\Python27',

path => 'C:\Python27;%PATH%',

#creates => 'C:\Program,

require => File['C:\Python27'], 

}
I have 'file' block as well, which is copies the file first, before 
execution. However, I am getting following error:
**
C:\Program Files\Puppet Labs\Puppet Enterprise\bin>puppet agent --test 
--server
qalab2.pertino.com
info: Retrieving plugin
err: /File[C:/ProgramData/PuppetLabs/puppet/var/lib]: Could not evaluate: 
Could
not retrieve information from environment production source(s) 
puppet://qalab2.p
ertino.com/plugins
info: Caching catalog for homebasic32.pertino.com
info: Applying configuration version '1351047345'
err: /Stage[main]//Exec[ez_setup.py  -U setuptools]/returns: change from 
notrun
to 0 failed: CreateProcess() failed:
notice: Finished catalog run in 4.06 seconds

**
I have no idea how to debug. Pls help!

Great Thanks,
Viktoriya

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/S3z9K-EZwoYJ.
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: Puppet interacting with CloudStack API (Ruby API client)

2012-10-23 Thread Jeff McCune
Ray,

Are you the author of Class[Csapiclient] ?  If so, the only suggestion I
have is to try and find API calls that return the data you need in a
quicker manner.  The way the catalog and the resource abstraction layer
operate is built on top of an assumption of synchronous and relatively fast
system calls.  Asynchronous and relatively slow network API calls aren't
well suited for types and providers.

Hope this helps,
-Jeff

On Tue, Oct 23, 2012 at 9:02 AM, Ray  wrote:

> root@puppet30client:~# puppet agent --evaltrace --trace --test
> --configtimeout 5m
>
> Info: Retrieving plugin
> Info: Loading facts in /var/lib/puppet/lib/facter/centos_version.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/network-bonds.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/powerstates.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/software_raid.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/centos-version.rb
> Info: Caching catalog for puppet30client
> Info: Applying configuration version '1351007512'
> Info: /Schedule[daily]: Starting to evaluate the resource
> Info: /Schedule[daily]: Evaluated in 0.00 seconds
> Info: /Schedule[monthly]: Starting to evaluate the resource
> Info: /Schedule[monthly]: Evaluated in 0.00 seconds
> Info: /Schedule[hourly]: Starting to evaluate the resource
> Info: /Schedule[hourly]: Evaluated in 0.00 seconds
> Info: Stage[main]: Starting to evaluate the resource
> Info: Stage[main]: Evaluated in 0.00 seconds
> Info: Class[Main]: Starting to evaluate the resource
> Info: Class[Main]: Evaluated in 0.00 seconds
> Info: Class[Yum]: Starting to evaluate the resource
> Info: Class[Yum]: Evaluated in 0.00 seconds
> Info: /Stage[main]/Yum/Package[yum-plugin-priorities]: Starting to
> evaluate the resource
> Info: /Stage[main]/Yum/Package[yum-plugin-priorities]: Evaluated in 0.00
> seconds
> Info: Set_yum_repo[epel]: Starting to evaluate the resource
> Info: Set_yum_repo[epel]: Evaluated in 0.04 seconds
> Info: Class[Csapiclient]: Starting to evaluate the resource
> Info: Class[Csapiclient]: Evaluated in 0.00 seconds
> Info: Node[puppet30client]: Starting to evaluate the resource
> Info: Node[puppet30client]: Evaluated in 0.00 seconds
> Info: Class[Centos]: Starting to evaluate the resource
> Info: Class[Centos]: Evaluated in 0.00 seconds
> Info: /File[/etc/profile.d/raimunds_favorite_aliases.sh]: Starting to
> evaluate the resource
> Info: /File[/etc/profile.d/raimunds_favorite_aliases.sh]: Evaluated in
> 0.00 seconds
> Info: Replace_line[Set_default_global_HISTSIZE]: Starting to evaluate the
> resource
> Info: Replace_line[Set_default_global_HISTSIZE]: Evaluated in 0.00 seconds
> Info: Class[Settings]: Starting to evaluate the resource
> Info: Class[Settings]: Evaluated in 0.00 seconds
> Info: Class[Settings]: Starting to evaluate the resource
> Info: Class[Settings]: Evaluated in 0.00 seconds
> Info: /Stage[main]/Yum/Package[yum-plugin-fastestmirror]: Starting to
> evaluate the resource
> Info: /Stage[main]/Yum/Package[yum-plugin-fastestmirror]: Evaluated in
> 0.00 seconds
> Info: Class[Puppet::Client]: Starting to evaluate the resource
> Info: Class[Puppet::Client]: Evaluated in 0.00 seconds
> Info: /File[yum_epel.repo]: Starting to evaluate the resource
> Info: /File[yum_epel.repo]: Evaluated in 0.00 seconds
> Info: Set_yum_repo[epel]: Starting to evaluate the resource
> Info: Set_yum_repo[epel]: Evaluated in 0.00 seconds
> Info: /Stage[main]/Centos/Package[bind-utils]: Starting to evaluate the
> resource
> Info: /Stage[main]/Centos/Package[bind-utils]: Evaluated in 0.00 seconds
> Info: /Stage[main]/Centos/Package[xorg-x11-fonts-Type1]: Starting to
> evaluate the resource
> Info: /Stage[main]/Centos/Package[xorg-x11-fonts-Type1]: Evaluated in 0.00
> seconds
> Info: /Stage[main]/Centos/Package[make]: Starting to evaluate the resource
> Info: /Stage[main]/Centos/Package[make]: Evaluated in 0.00 seconds
> Info: /Stage[main]/Centos/Package[finger]: Starting to evaluate the
> resource
> Info: /Stage[main]/Centos/Package[finger]: Evaluated in 0.00 seconds
> Info: /Stage[main]/Centos/Package[openssh-clients]: Starting to evaluate
> the resource
> Info: /Stage[main]/Centos/Package[openssh-clients]: Evaluated in 0.00
> seconds
> Info: /Stage[main]/Centos/Package[traceroute]: Starting to evaluate the
> resource
> Info: /Stage[main]/Centos/Package[traceroute]: Evaluated in 0.00 seconds
> Info: /Stage[main]/Centos/Package[htop]: Starting to evaluate the resource
> Info: /Stage[main]/Centos/Package[htop]: Evaluated in 0.00 seconds
> Info: /Stage[main]/Centos/Package[tcpdump]: Starting to evaluate the
> resource
> Info: /Stage[main]/Centos/Package[tcpdump]: Evaluated in 0.00 seconds
> Info: /Stage[main]/Centos/Package[wget]: Starting to evaluate the resource
> Info: /Stage[main]/Centos/Package[wget]: Evaluated in 0.00 seconds
> Info: /Stage[main]/Centos/Package[screen]: Starting to evaluate the
> resource
> Info: /Stage[main]/Centos/Package[screen]: Evaluated in 0.00 seconds
> Info

[Puppet Users] Re: Puppet interacting with CloudStack API (Ruby API client)

2012-10-23 Thread Ray
root@puppet30client:~# puppet agent --evaltrace --trace --test 
--configtimeout 5m
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/centos_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/network-bonds.rb
Info: Loading facts in /var/lib/puppet/lib/facter/powerstates.rb
Info: Loading facts in /var/lib/puppet/lib/facter/software_raid.rb
Info: Loading facts in /var/lib/puppet/lib/facter/centos-version.rb
Info: Caching catalog for puppet30client
Info: Applying configuration version '1351007512'
Info: /Schedule[daily]: Starting to evaluate the resource
Info: /Schedule[daily]: Evaluated in 0.00 seconds
Info: /Schedule[monthly]: Starting to evaluate the resource
Info: /Schedule[monthly]: Evaluated in 0.00 seconds
Info: /Schedule[hourly]: Starting to evaluate the resource
Info: /Schedule[hourly]: Evaluated in 0.00 seconds
Info: Stage[main]: Starting to evaluate the resource
Info: Stage[main]: Evaluated in 0.00 seconds
Info: Class[Main]: Starting to evaluate the resource
Info: Class[Main]: Evaluated in 0.00 seconds
Info: Class[Yum]: Starting to evaluate the resource
Info: Class[Yum]: Evaluated in 0.00 seconds
Info: /Stage[main]/Yum/Package[yum-plugin-priorities]: Starting to evaluate 
the resource
Info: /Stage[main]/Yum/Package[yum-plugin-priorities]: Evaluated in 0.00 
seconds
Info: Set_yum_repo[epel]: Starting to evaluate the resource
Info: Set_yum_repo[epel]: Evaluated in 0.04 seconds
Info: Class[Csapiclient]: Starting to evaluate the resource
Info: Class[Csapiclient]: Evaluated in 0.00 seconds
Info: Node[puppet30client]: Starting to evaluate the resource
Info: Node[puppet30client]: Evaluated in 0.00 seconds
Info: Class[Centos]: Starting to evaluate the resource
Info: Class[Centos]: Evaluated in 0.00 seconds
Info: /File[/etc/profile.d/raimunds_favorite_aliases.sh]: Starting to 
evaluate the resource
Info: /File[/etc/profile.d/raimunds_favorite_aliases.sh]: Evaluated in 0.00 
seconds
Info: Replace_line[Set_default_global_HISTSIZE]: Starting to evaluate the 
resource
Info: Replace_line[Set_default_global_HISTSIZE]: Evaluated in 0.00 seconds
Info: Class[Settings]: Starting to evaluate the resource
Info: Class[Settings]: Evaluated in 0.00 seconds
Info: Class[Settings]: Starting to evaluate the resource
Info: Class[Settings]: Evaluated in 0.00 seconds
Info: /Stage[main]/Yum/Package[yum-plugin-fastestmirror]: Starting to 
evaluate the resource
Info: /Stage[main]/Yum/Package[yum-plugin-fastestmirror]: Evaluated in 0.00 
seconds
Info: Class[Puppet::Client]: Starting to evaluate the resource
Info: Class[Puppet::Client]: Evaluated in 0.00 seconds
Info: /File[yum_epel.repo]: Starting to evaluate the resource
Info: /File[yum_epel.repo]: Evaluated in 0.00 seconds
Info: Set_yum_repo[epel]: Starting to evaluate the resource
Info: Set_yum_repo[epel]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[bind-utils]: Starting to evaluate the 
resource
Info: /Stage[main]/Centos/Package[bind-utils]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[xorg-x11-fonts-Type1]: Starting to 
evaluate the resource
Info: /Stage[main]/Centos/Package[xorg-x11-fonts-Type1]: Evaluated in 0.00 
seconds
Info: /Stage[main]/Centos/Package[make]: Starting to evaluate the resource
Info: /Stage[main]/Centos/Package[make]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[finger]: Starting to evaluate the resource
Info: /Stage[main]/Centos/Package[finger]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[openssh-clients]: Starting to evaluate 
the resource
Info: /Stage[main]/Centos/Package[openssh-clients]: Evaluated in 0.00 
seconds
Info: /Stage[main]/Centos/Package[traceroute]: Starting to evaluate the 
resource
Info: /Stage[main]/Centos/Package[traceroute]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[htop]: Starting to evaluate the resource
Info: /Stage[main]/Centos/Package[htop]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[tcpdump]: Starting to evaluate the 
resource
Info: /Stage[main]/Centos/Package[tcpdump]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[wget]: Starting to evaluate the resource
Info: /Stage[main]/Centos/Package[wget]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[screen]: Starting to evaluate the resource
Info: /Stage[main]/Centos/Package[screen]: Evaluated in 0.00 seconds
Info: /Stage[main]/Yum/Exec[yum-clean-all]: Starting to evaluate the 
resource
Info: /Stage[main]/Yum/Exec[yum-clean-all]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[vim-common]: Starting to evaluate the 
resource
Info: /Stage[main]/Centos/Package[vim-common]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[sysstat]: Starting to evaluate the 
resource
Info: /Stage[main]/Centos/Package[sysstat]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[man]: Starting to evaluate the resource
Info: /Stage[main]/Centos/Package[man]: Evaluated in 0.00 seconds
Info: /Stage[main]/Centos/Package[curl]: Star

[Puppet Users] Git clone manifest for windows puppet clinet

2012-10-23 Thread VT
Can anybody help to come up with a manifest file, which should instruct a 
puppet client running on windows to clone a repository from github directly 
to puppet client? Great thanks for help!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/h1uawzvFDZ8J.
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] Puppet on OpenSuSE & SLES

2012-10-23 Thread Niels Abspoel
Hi Darin,

To save you some time:
can you take a look at this package:

Somebody on opensuse build service made a very old ruby-shadow package and 
I updated the spec file for ruby-shadow 2.1.4.
I also cleaned the old sources and patches.

https://build.opensuse.org/package/show?package=ruby-shadow&project=home%3Aaboe76%3Abranches%3Ahome%3Amcadet

Op maandag 22 oktober 2012 17:57:27 UTC+2 schreef Darin Perusich het 
volgende:
>
> Hi Niels, 
>
> The only thing those SuSE packages are missing, imo, is the 
> ruby-shadow packages and dependency.  I've been meaning to submit 
> ruby-shadow and an updated spec to systemsmanagement:puppet just 
> haven't had the time. 
>
> -- 
> Later, 
> Darin 
>
>
> On Mon, Oct 22, 2012 at 1:18 AM, Niels Abspoel 
> > 
> wrote: 
> > Or you can go to https://build.opensuse.org/ 
> > 
> > They have two projects running: 
> > 2.7.19: systemsmanagement-puppet 
> > 
> > 3.0.0:  systemsmanagement-puppet-devel-package=puppet 
> > 
> > and my own 
> > 3.0.1: home-Aaboe76-branches-systemsmanagement-puppet-devel 
> > 
> > These are packages build for suse and tested on my machine. 
> > 
> > Greetz, 
> > Niels 
> > 
> > 
> > Op donderdag 29 maart 2012 15:03:36 UTC+2 schreef Darin Perusich het 
> > volgende: 
> >> 
> >> You can grab the .spec from the build service project or the srpm links 
> >> below. 
> >> 
> >> http://download.opensuse.org/repositories/home:/eclipseagent:/puppet/ 
> >> 
> >> 
> https://build.opensuse.org/project/show?project=home%3Aeclipseagent%3Apuppet 
> >> 
> >> -- 
> >> Later, 
> >> Darin 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Puppet Users" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/puppet-users/-/-vYDo6vaqmIJ. 
> > 
> > To post to this group, send email to 
> > puppet...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > puppet-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/5ZeARVV0RsoJ.
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: How to remove data from hiera programtically

2012-10-23 Thread llowder


On Tuesday, October 23, 2012 4:22:59 PM UTC-5, Nishant Jain wrote:
>
> Hello Everybody,
>   Is it possible to store and remove data from 
> hiera(the yaml files) programatically ???
>

Sure, just use one of the YAML libraries and whatever language you want. 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/K6lu2GfrNTwJ.
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] How to remove data from hiera programtically

2012-10-23 Thread Nishant Jain
Hello Everybody,
  Is it possible to store and remove data from 
hiera(the yaml files) programatically ???

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/2z56Xgt-E3wJ.
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] Puppet on OpenSuSE & SLES

2012-10-23 Thread Niels Abspoel
I see, just finished puppet 3.0.1 package in my home projects and made a 
request to systemsmanagement:puppet:devel to be included.

To make it fully functional we need ruby-shadow package in some suse repo...
maybe we can use the same sources as :rubygem-hiera and adjust it for 
ruby-shadow

https://build.opensuse.org/package/files?package=rubygem-hiera&project=systemsmanagement%3Apuppet%3Adevel


Op maandag 22 oktober 2012 17:57:27 UTC+2 schreef Darin Perusich het 
volgende:
>
> Hi Niels, 
>
> The only thing those SuSE packages are missing, imo, is the 
> ruby-shadow packages and dependency.  I've been meaning to submit 
> ruby-shadow and an updated spec to systemsmanagement:puppet just 
> haven't had the time. 
>
> -- 
> Later, 
> Darin 
>
>
> On Mon, Oct 22, 2012 at 1:18 AM, Niels Abspoel 
> > 
> wrote: 
> > Or you can go to https://build.opensuse.org/ 
> > 
> > They have two projects running: 
> > 2.7.19: systemsmanagement-puppet 
> > 
> > 3.0.0:  systemsmanagement-puppet-devel-package=puppet 
> > 
> > and my own 
> > 3.0.1: home-Aaboe76-branches-systemsmanagement-puppet-devel 
> > 
> > These are packages build for suse and tested on my machine. 
> > 
> > Greetz, 
> > Niels 
> > 
> > 
> > Op donderdag 29 maart 2012 15:03:36 UTC+2 schreef Darin Perusich het 
> > volgende: 
> >> 
> >> You can grab the .spec from the build service project or the srpm links 
> >> below. 
> >> 
> >> http://download.opensuse.org/repositories/home:/eclipseagent:/puppet/ 
> >> 
> >> 
> https://build.opensuse.org/project/show?project=home%3Aeclipseagent%3Apuppet 
> >> 
> >> -- 
> >> Later, 
> >> Darin 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Puppet Users" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/puppet-users/-/-vYDo6vaqmIJ. 
> > 
> > To post to this group, send email to 
> > puppet...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > puppet-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/pOm4tlNJ2LoJ.
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] FreeBSD 3.0 Port

2012-10-23 Thread Worker Bee
Can you direct me to a VERY beginner's guide for hiera?  I have never used
it and I need to be able to test the functionality before I deploy to my
end users.  Is there any way to quickly verify the functionality?

Thanks a MILLION!
Bee

On Tue, Oct 23, 2012 at 2:58 PM, Michael Stahnke wrote:

> On Tue, Oct 23, 2012 at 11:14 AM, Worker Bee 
> wrote:
> > Hi Everyone;
> >
> > So, the FreeBSD Port is now available.  However, I am a bit confused
> about
> > hiera.  The Makefile does not list rubygem-puppet-hiera as a requirement
> for
> > the agent.  This IS required in the redhat spec files for the agent.  So,
> > can someone clear up for me, is this needed on boxes that will have only
> the
> > agent installed?
>
> It is needed everywhere. When using Puppet apply puppet attempts a
> lookup via hiera for parameterized classes.
> >
> > Thanks!
> > Bee
> >
> >
> > On Wed, Oct 17, 2012 at 11:54 AM, James Turnbull 
> > wrote:
> >>
> >> Worker Bee wrote:
> >> > Hi Everyone;
> >> >
> >> > Has anyone created a puppet agent 3.0 BSD port?
> >> >
> >> > I would be very grateful to get my hands on it!
> >> >
> >>
> >> One of my colleagues informs me the FreeBSD 3.0 port should be ready
> >> early next week.
> >>
> >> http://www.freebsd.org/cgi/ports.cgi?query=puppet&stype=all
> >>
> >> Regards
> >>
> >> James
> >>
> >>
> >> --
> >> James Turnbull
> >> Puppet Labs
> >> 1-503-734-8571
> >> To schedule a meeting with me: http://doodle.com/jamtur01
> >>
> >> --
> >> 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.
> >>
> >
> > --
> > 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.
>
> --
> 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.
>
>

-- 
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] FreeBSD 3.0 Port

2012-10-23 Thread Michael Stahnke
On Tue, Oct 23, 2012 at 11:14 AM, Worker Bee  wrote:
> Hi Everyone;
>
> So, the FreeBSD Port is now available.  However, I am a bit confused about
> hiera.  The Makefile does not list rubygem-puppet-hiera as a requirement for
> the agent.  This IS required in the redhat spec files for the agent.  So,
> can someone clear up for me, is this needed on boxes that will have only the
> agent installed?

It is needed everywhere. When using Puppet apply puppet attempts a
lookup via hiera for parameterized classes.
>
> Thanks!
> Bee
>
>
> On Wed, Oct 17, 2012 at 11:54 AM, James Turnbull 
> wrote:
>>
>> Worker Bee wrote:
>> > Hi Everyone;
>> >
>> > Has anyone created a puppet agent 3.0 BSD port?
>> >
>> > I would be very grateful to get my hands on it!
>> >
>>
>> One of my colleagues informs me the FreeBSD 3.0 port should be ready
>> early next week.
>>
>> http://www.freebsd.org/cgi/ports.cgi?query=puppet&stype=all
>>
>> Regards
>>
>> James
>>
>>
>> --
>> James Turnbull
>> Puppet Labs
>> 1-503-734-8571
>> To schedule a meeting with me: http://doodle.com/jamtur01
>>
>> --
>> 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.
>>
>
> --
> 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.

-- 
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: Failed to set group to '0': Operation not permitted

2012-10-23 Thread Stefan Schulte
On Mon, Oct 22, 2012 at 03:05:40PM -0700, jcbollinger wrote:
> I'm not sure why that inherently means you don't have root, but whatever.
> 
> So, supposing the issue is with 
> File["/home/user/rabbitmq-server-generic-unix-2.8.7.tar.gz"], it's not 
> immediately clear to me whether Puppet's behavior is correct here.  It 
> seems to be defaulting the target group to 0 (since you don't specify a 
> group, that has to be coming in as a default).  That's not documented 
> behavior, but it may still be intentional.  On the other hand, it is usual 
> for the agent to run as root, which would mask this behavior.  I would 
> suggest that you file a ticket.
> 

If you do not specify owner/group/mode and you don't have a global
default and the file needs to be created, it will be created with
owner/group/mode of the source file. This can of course fail if the
agent is not run as root.

FWIW there was a discussion about the current behaviour quite a while
ago, but the last comment is over a year old now:
http://projects.puppetlabs.com/issues/5240

-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-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] FreeBSD 3.0 Port

2012-10-23 Thread Worker Bee
Hi Everyone;

So, the FreeBSD Port is now available.  However, I am a bit confused about
hiera.  The Makefile does not list rubygem-puppet-hiera as a requirement
for the agent.  This IS required in the redhat spec files for the agent.
So, can someone clear up for me, is this needed on boxes that will have
only the agent installed?

Thanks!
Bee

On Wed, Oct 17, 2012 at 11:54 AM, James Turnbull wrote:

> Worker Bee wrote:
> > Hi Everyone;
> >
> > Has anyone created a puppet agent 3.0 BSD port?
> >
> > I would be very grateful to get my hands on it!
> >
>
> One of my colleagues informs me the FreeBSD 3.0 port should be ready
> early next week.
>
> http://www.freebsd.org/cgi/ports.cgi?query=puppet&stype=all
>
> Regards
>
> James
>
>
> --
> James Turnbull
> Puppet Labs
> 1-503-734-8571
> To schedule a meeting with me: http://doodle.com/jamtur01
>
> --
> 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.
>
>

-- 
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] Is the assignment of variables executed before the package resource?

2012-10-23 Thread Apple Wang
Hi, David

Thanks for your reply. I have been more clear about the compiling of puppet.
Do you have any good method to get the package version after installing if 
with Package resource? I need the version to configure the my.cnf file.

I know a method to get the version of packages that already installed, 
which are as follows.

Puppet::Parser::Functions::newfunction(:get_pkg_version, :type => :rvalue) 
do |args|
  pkg_name = args[0]
  pkg = Puppet::Type.type(:package).new(:name => pkg_name)
  version = pkg.retrieve[pkg.property(:ensure)].to_s
  version.split(/-|\+/).at 0
end

But is there any function of Package type that can get the latest version 
in the software repository (e.g. yum or zypper)? So that I can get the 
version of a package which will be installed and configure its conf file.

Really looking forward for your answer!

Thanks
Apple

在 2012年10月23日星期二UTC+8下午10时49分03秒,David Schmitt写道:
>
> Hi, 
>
> the function is executed on the puppet master at the time of compiling 
> the catalog. 
>
> The catalog is then transferred to the agent where all resources are 
> applied. 
>
> Depending on your setup this might not only be two different stages in 
> the process, but also two different machines! 
>
> This is explained in more depth here: 
>
> > http://docs.puppetlabs.com/learning/manifests.html 
>
>
> Best Regards, David 
>
> On 23.10.2012 11:09, Apple Wang wrote: 
> > Hi, all 
> > I'm confused about the execution sequence in puppet. 
> > *The background:* 
> > ** I want to get mysql package version after installing it with the 
> > Package resource. And I'll configure /etc/my.cnf according the version 
> > of mysql package. The code is as following. 
> >  --- 
> >  class mysql{ 
> >  package { "mysql": 
> > ensure => latest, 
> >  } 
> >  $mysql_version = get_pkg_version("mysql") 
> > 
> >  file { '/etc/my.cnf': 
> >   ensure => present, 
> >   content => template('mysql/mysql.cnf'), 
> >   require => Package["mysql"], 
> >   } 
> >  } 
> >  - 
> > Note: get_pkg_version is a user defined function written by me. It 
> > can get mysql rpm version when mysql is installed. 
> > 
> > *Issue:* 
> >  First time I executed /*puppet agent -t*, /the variable 
> > */mysql_version/* didn't get the value of mysql rpm version. 
> >  But the second time, after mysql is installed. 
> > */mysql_version/* can get the value of mysql rpm version. 
> > 
> > Can anyone help me with the problem? 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Puppet Users" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/puppet-users/-/4uL89crPzDsJ. 
> > To post to this group, send email to 
> > puppet...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > puppet-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/2qqLpZthbU4J.
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] About execution sequence in puppet.

2012-10-23 Thread Erik Dalén
If you are running with a master/slave setup functions are executed on the 
puppet master as part of the compilation. So it won't really work, and there is 
no way to change the ordering.

To execute that on the client you will need to create a custom fact, but it 
will always be executed before the puppet run starts. So if you are okay with 
it taking two puppet runs to fully configure the node you can use that method 
and the fact will be available on the second puppet run after the package has 
been installed.

Another way would be to specify which package version you want and install that 
version and use the same version variable in the template.  

--  
Erik Dalén


On Tuesday 23 October 2012 at 12:04, Apple Wang wrote:

> Hi, all
>  
> I have some questions about the execution sequence in puppet.
>  
> The background:
> I want to install mysql package and configure /etc/my.cnf according to the 
> version of mysql. So I wrote an user defined function to get mysql rpm 
> version. Codes are as follows.
> 
> class mysql {
> package { 'mysql':
> ensure => latest,
> }
>  
> $mysql_version = get_pkg_version("mysql")
>  
> file { '/etc/my.cnf':
> ensure => present,
> mode => '0644',
> content => template('mysql/mysql.cnf'),
> require => Package['mysql'],
> }
> }
>  
> Note: get_pkg_version is the user defined function to get mysql rpm version.
> ---
> Issue:
> The first time I execute puppet agent -t, the variable mysql_version couldn't 
> get the version of mysql. And I found it was executed before the installation 
> of mysql package. And the second time I execute puppet agent -t, the variable 
> mysql_version got the version of mysql installed after the first time.
>  
> So, my question is that are variables assignment executed before the 
> resources such as Package, Service, File..etc?  
> Is there any method can make $mysql_version = get_pkg_version("mysql") 
> executed after Package['mysql']?
>  
> Really looking forward to your answers!
>  
> --  
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/puppet-users/-/6NzlmgjiBHUJ.
> To post to this group, send email to puppet-users@googlegroups.com 
> (mailto:puppet-users@googlegroups.com).
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com 
> (mailto: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-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] puppet ca generate --dns-alt-names

2012-10-23 Thread Jeff McCune
On Tue, Oct 23, 2012 at 2:24 AM, Jonathan Gazeley <
jonathan.gaze...@bristol.ac.uk> wrote:

> I'm trying to generate a CA certificate that will be used on multiple
> puppet masters, accessed by round robin DNS.
>
> The individual nodes have their own hostnames and the round robin name is
> puppet.resnet.bris.ac.uk or puppet.resnet.bristol.ac.uk (the twin domain
> name for Bristol university is historical, and a total pain).
>
> However I'm having trouble with puppet ca as follows:
>
> [jg4461@puppet1 ~]$ sudo puppet ca generate --dns_alt_names
> puppet.resnet.bris.ac.uk
> Error: puppet ca generate takes 1 argument, but you gave 0
> Error: Try 'puppet help ca generate' for usage
>

This command adds "puppet.resnet.bris.ac.uk" to the x.509 alternate names
field, but Puppet is still expecting the value of the common name.  If the
common name is "foo.resnet.bris.ac.uk" then try the command: sudo puppet ca
generate --dns_alt_names puppet.resnet.bris.ac.uk foo.resnet.bris.ac.uk.


>
> [jg4461@puppet-1 ~]$ sudo puppet ca generate --dns_alt_names=
> puppet.resnet.**bris.ac.uk ,
> puppet.resnet.bristol.ac.uk
>

Did you mean to have a space between the comma and the next word here?


> Error: The certificate retrieved from the master does not match the
> agent's private key.
>

This error happens when the CSR you're trying to sign already has a signed
certificate.  In this scenario, Puppet does not sign the CSR and instead
simply returns the already present certificate.


> To fix this, remove the certificate from both the master and the agent and
> then start a puppet run, which will automatically regenerate a certficate.
> On the master:
>   puppet cert clean puppet1.resnet.bris.ac.uk
> On the agent:
>   rm -f /var/lib/puppet/ssl/certs/**puppet1.resnet.bris.ac.uk.pem
>   puppet agent -t
>
> [jg4461@puppet1 ~]$ puppet --version
> 3.0.1
>
>
> Am I doing something wrong, or is something broken?
>

It doesn't seem like anything is broken beyond the normal difficulties with
x.509 certificates.  It just seems like there's an already existing
certificate named "puppet1.resnet.bris.ac.uk"

Hope this helps,
-Jeff

-- 
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] About execution sequence in puppet.

2012-10-23 Thread Apple Wang
Hi, all

I have some questions about the execution sequence in puppet.

*The background:*
  I want to install mysql package and configure /etc/my.cnf according to 
the version of mysql. So I wrote an user defined function to get mysql rpm 
version. Codes are as follows.
 
  class mysql {
package { 'mysql':
  ensure => latest,
}

$mysql_version = get_pkg_version("mysql")

file { '/etc/my.cnf':
ensure => present,
mode=> '0644',
content => template('mysql/mysql.cnf'),
require => Package['mysql'],
 }
  }

  Note: get_pkg_version is the user defined function to get mysql rpm 
version.
---
*Issue:*
   The first time I execute *puppet agent -t*, the variable 
*mysql_version*couldn't get the version of mysql. And I found it was executed 
before the 
installation of mysql package. And the second time I execute *puppet agent 
-t*, the variable *mysql_version* got the version of mysql installed after 
the first time.

So, my question is that are variables assignment executed before the 
resources such as Package, Service, File..etc? 
Is there any method can make *$mysql_version = get_pkg_version("mysql") 
*executed 
after *Package['mysql']*?

Really looking forward to your answers!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/6NzlmgjiBHUJ.
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] Puppet interacting with CloudStack API (Ruby API client)

2012-10-23 Thread Jeff McCune
On Tue, Oct 23, 2012 at 7:20 AM, Ray  wrote:

> Hi,
>
> I want Puppet to talk to the CloudStack API. CloudStack has many
> asynchronous API calls and Puppet's catalog run tends to expire even during
> simple tasks such as adding port forwarding rules:
>

Is it the catalog run, or the catalog retrieval that's expiring?  In the
example you provided the configtimeout setting affects how long the agent
waits for the catalog to be compiled on the master and retrieved by the
agent.  Catalog runs, which is the process of applying a catalog to a
system, shouldn't have a timeout by default.

Hope this helps,
-Jeff


> root@puppet30client:~# puppet agent --test
> Info: Retrieving plugin
> Info: Loading facts in /var/lib/puppet/lib/facter/centos_version.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/network-bonds.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/powerstates.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/software_raid.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/centos-version.rb
>
> Error: Could not retrieve catalog from remote server: execution expired
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
> root@puppet30client:~#
>
>
> When I grant the puppetrun more time than the default 2 minutes, it comes
> back successfully:
>
> root@puppet30client:~# puppet agent --test --configtimeout 5m
> Info: Retrieving plugin
> Info: Loading facts in /var/lib/puppet/lib/facter/centos_version.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/network-bonds.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/powerstates.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/software_raid.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/centos-version.rb
>
> Info: Caching catalog for puppet30client.swisstxt.ch
> Info: Applying configuration version '1351000748'
> Finished catalog run in 1.88 seconds
> root@puppet30client:~#
>
> (Don't believe the 1.88 seconds - this run took about three minutes(!))
>

There's something wrong if Puppet is lying to you that much.  Could you run
with --evaltrace, --trace, and --debug and paste the output somewhere.  A
copy of the YAML report might also help diagnose the issue.

Hope this helps,
-Jeff

-- 
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] Disabling root user

2012-10-23 Thread Ben McCann
Thanks Christopher. That worked. It looks like either an asterisk or an 
exclamation mark will work as I see either in /etc/shadow for various 
accounts.

Thanks,
Ben


On Tuesday, October 23, 2012 4:44:40 AM UTC-7, Christopher Wood wrote:
>
> I don't believe you'll be able to remove the root user without massive 
> system breakage due to how it's an essential system account. For example, 
> your PID 1 likely runs as root. 
>
> Perhaps try something like this untested fragment, given how the star is 
> sometimes used to disable a password: 
>
> user { 'root': 
> password => '*', 
> } 
>
> http://docs.puppetlabs.com/references/latest/type.html#user 
>
> On Tue, Oct 23, 2012 at 12:08:59AM -0700, Ben McCann wrote: 
> >I have some machines running Ubuntu that have a root user on them 
> setup by 
> >my web host.  I'd like to disable the root user. 
> >I tried: 
> >  user { 'root': 
> >ensure => absent, 
> >  } 
> >But got the error message: 
> >err: /Stage[main]/Users/User[root]/ensure: change from present to 
> absent 
> >failed: Could not delete user root: Execution of '/usr/sbin/userdel 
> root' 
> >returned 8: userdel: user root is currently logged in 
> >However, I don't believe the root user is logged in.  Is it not 
> possible 
> >to delete the root user?  Is there something else I should do such as 
> >disabling its password? 
> >Thanks, 
> >Ben 
> > 
> >-- 
> >You received this message because you are subscribed to the Google 
> Groups 
> >"Puppet Users" group. 
> >To view this discussion on the web visit 
> >[1]https://groups.google.com/d/msg/puppet-users/-/VOgfDBb9GuAJ. 
> >To post to this group, send email to 
> > puppet...@googlegroups.com. 
>
> >To unsubscribe from this group, send email to 
> >puppet-users...@googlegroups.com . 
> >For more options, visit this group at 
> >http://groups.google.com/group/puppet-users?hl=en. 
> > 
> > References 
> > 
> >Visible links 
> >1. https://groups.google.com/d/msg/puppet-users/-/VOgfDBb9GuAJ 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/ZT_3HsFLa2cJ.
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] regex not working in node.pp

2012-10-23 Thread Johnathan Phan
Hi everyone,

My puppet master version is 2.7.6. The client runs on 2.6.17.

the clients hostname is java1.test.example.com.

I have used the following guide to setup resolv.conf properties.

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

I have setup the following record in nodes.pp

node /\.test\.example\.com/ {import "resolv" resolv_conf { 
"test.example.com":
  domainname  => "",
  searchpath  => ['test.example.com'],
  nameservers => ['192.168.2.1', '192.168.2.2'],
  }
  } 

I have tried the following regex combination for the declaration of the 
node.

/java[0-9].test\.example\.com/
/.*\.test\.example\.com/
/(.*)\.test\.example\.com/
/java1|java2\.test\.example\.com/

None of these references will activate when running puppetd -tv on the host 
target machine.

I want to use regex to make sure all the servers under test.example.com get 
this special resolv.conf properties. However it's not working. regex in any 
shape or form works. I checked puppet versions and regex was added in 2.5. 
so I am not sure how to troubleshoot this further.

does anyone know of any tests I can do to find out what is wrong?

Regards

John




-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/QpWDH_hn6gQJ.
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] Puppet interacting with CloudStack API (Ruby API client)

2012-10-23 Thread Ray
Hi,

I want Puppet to talk to the CloudStack API. CloudStack has many 
asynchronous API calls and Puppet's catalog run tends to expire even during 
simple tasks such as adding port forwarding rules:

root@puppet30client:~# puppet agent --test
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/centos_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/network-bonds.rb
Info: Loading facts in /var/lib/puppet/lib/facter/powerstates.rb
Info: Loading facts in /var/lib/puppet/lib/facter/software_raid.rb
Info: Loading facts in /var/lib/puppet/lib/facter/centos-version.rb

Error: Could not retrieve catalog from remote server: execution expired
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
root@puppet30client:~# 


When I grant the puppetrun more time than the default 2 minutes, it comes 
back successfully:

root@puppet30client:~# puppet agent --test --configtimeout 5m
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/centos_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/network-bonds.rb
Info: Loading facts in /var/lib/puppet/lib/facter/powerstates.rb
Info: Loading facts in /var/lib/puppet/lib/facter/software_raid.rb
Info: Loading facts in /var/lib/puppet/lib/facter/centos-version.rb

Info: Caching catalog for puppet30client.swisstxt.ch
Info: Applying configuration version '1351000748'
Finished catalog run in 1.88 seconds
root@puppet30client:~# 

(Don't believe the 1.88 seconds - this run took about three minutes(!))


My question is: What is the best practise to let Puppet interact with the 
CloudStack API?


What I did:

1) Created a csapiclient module and dumped a custom function: 
/etc/puppet/modules/csapiclient/lib/puppet/parser/functions/add_pf_rule.rb

require File.join(File.dirname(__FILE__), 'cloudstack_client')

module Puppet::Parser::Functions
  newfunction(:add_pf_rule) do |args|
apiurl = args[0]
apikey = args[1]
secretkey = args[2]
proto = args[3]
pubPort = args[4]
privPort = args[5]
ipId = args[6]
vmId = args[7]

cs = CloudstackClient::Connection.new(apiurl,apikey,secretkey)

cs.create_port_forwarding_rule( ipId, privPort, proto, pubPort, vmId)
  end
end

2) Wrote a defined resource that calls the Ruby function:

define addPFRule( $ipId, $vmId, $proto, $pubPort, $privPort ) {
# Pass arguments to Ruby function…
add_pf_rule( $apiUrl, $apiKey , $secretKey, $proto, $pubPort, 
$privPort, $ipId, $vmId )
}

3) Call the define from a recipe, feeding it with parameters.

Is this a viable way to go or are there better/simpler/more beautiful 
solutions to talk to CloudStack?

Cheers,
Raiy

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/8iKDPrIYmFoJ.
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] Is the assignment of variables executed before the package resource?

2012-10-23 Thread David Schmitt

Hi,

the function is executed on the puppet master at the time of compiling 
the catalog.


The catalog is then transferred to the agent where all resources are 
applied.


Depending on your setup this might not only be two different stages in 
the process, but also two different machines!


This is explained in more depth here:


http://docs.puppetlabs.com/learning/manifests.html



Best Regards, David

On 23.10.2012 11:09, Apple Wang wrote:

Hi, all
I'm confused about the execution sequence in puppet.
*The background:*
** I want to get mysql package version after installing it with the
Package resource. And I'll configure /etc/my.cnf according the version
of mysql package. The code is as following.
 ---
 class mysql{
 package { "mysql":
ensure => latest,
 }
 $mysql_version = get_pkg_version("mysql")

 file { '/etc/my.cnf':
  ensure => present,
  content => template('mysql/mysql.cnf'),
  require => Package["mysql"],
  }
 }
 -
Note: get_pkg_version is a user defined function written by me. It
can get mysql rpm version when mysql is installed.

*Issue:*
 First time I executed /*puppet agent -t*, /the variable
*/mysql_version/* didn't get the value of mysql rpm version.
 But the second time, after mysql is installed.
*/mysql_version/* can get the value of mysql rpm version.

Can anyone help me with the problem?


--
You received this message because you are subscribed to the Google
Groups "Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/4uL89crPzDsJ.
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.


--
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: puppet freezes on FUTEX_WAKE_PRIVATE

2012-10-23 Thread Richard Leitner
Hi everybody,
just for info:
I solved this issue after hours of strace'ing, tcp- and ssldump'ing.
And as you may expect it was simple.

In my case the /usr/share/puppet-dashboard/bin/external_node timed out, 
because it was trying to connect to ::1 port 3000 (the dashboard).
The timeout was caused by my ip6tables DROP policy.
So two lines of code resolved my issues:
ip6tables -A INPUT -i lo -j ACCEPT
ip6tables -A OUTPUT -o lo -j ACCEPT

Then one simple "service ip6tables save" and everything was in tall cotton.

A puppet agent --test now takes around 15 seconds again (instead of nearly 
3 minutes) *hooray!*

regards,
Richard

On Wednesday, October 17, 2012 5:23:07 PM UTC+2, Richard Leitner wrote:
>
> Hi,
> I don't know if this issue is still actual... but I'm suffering the same 
> thing.
>
> My puppet agent hangs for ~1 Minute with these messages:
>
>> 26297 16:49:19.735059 futex(0x33e6ce7ab0, FUTEX_WAKE_PRIVATE, 1) = 0
>> 26297 16:49:19.735127 futex(0x33e6ce7a84, 
>> FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 7, {1350485359, 745041001}, 
>> ) = -1 ETIMEDOUT (Connection timed out)
>> 26297 16:49:19.745244 futex(0x33e6ce7ab0, FUTEX_WAKE_PRIVATE, 1) = 0
>> 26297 16:49:19.745325 futex(0x33e6ce7a84, 
>> FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 9, {1350485359, 755228509}, 
>> ) = -1 ETIMEDOUT (Connection timed out)
>
>
> These lines repeat about 6000 times...
> Then the agent continues with:
>
>> 26265 16:50:22.898764 <... select resumed> ) = 1 (in [4], left {56, 
>> 826791})
>> 26265 16:50:22.898853 read(4, "\27\3\1\0\300", 5) = 5
>> 26265 16:50:22.898920 read(4, 
>> "\f\233\301\212\366\332X\277Q\273\n5\351\222\27\262\321#2*\350\260xPL\230\372\377!\366\270\355"...,
>>  
>> 192) = 192
>> 26265 16:50:22.899105 select(0, [], [], [], {0, 0}) = 0 (Timeout)
>> 26265 16:50:22.899271 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
>> 26265 16:50:22.899495 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
>
>
> Have anybody any idea?
>
> One thing: It's definitely not the leap-second bug, the machine was born 
> afterwards ;-)
>
> best regards,
> Richard
>
> On Monday, July 16, 2012 10:00:54 AM UTC+2, Ernest Beinrohr wrote:
>>
>> Same here, we have this issue from the beginning (~3m). I am now forced 
>> to restart the service every hour :(
>>
>> On Monday, July 16, 2012 9:56:15 AM UTC+2, Thomas Sturm wrote:
>>>
>>>
 Is this a relativly new issue for you? FUTEX_WAIT reminds me of the 
 leap 
 second kernelbug. If that's the case setting the time will fix the 
 issue. 


 http://serverfault.com/questions/407224/java-process-opends-consumes-all-cpu-futex-flood-how-to-debug-futex
  

 -Stefan 


>>> No, we already noticed this some weeks ago, so I don't think it has to 
>>> do with the leap second bug. The process also doesn't consume much CPU, it 
>>> just waits.
>>>
>>> Thomas
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/caDSHw4l8OIJ.
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] Is the assignment of variables executed before the package resource?

2012-10-23 Thread Apple Wang
Hi, all
I'm confused about the execution sequence in puppet.
*The background:*
*   * I want to get mysql package version after installing it with the 
Package resource. And I'll configure /etc/my.cnf according the version of 
mysql package. The code is as following.
---
class mysql{
package { "mysql":
   ensure => latest,
}
  
$mysql_version = get_pkg_version("mysql")

file { '/etc/my.cnf':
 ensure => present,
 content => template('mysql/mysql.cnf'),
 require => Package["mysql"],
 }
}
-
   Note: get_pkg_version is a user defined function written by me. It can 
get mysql rpm version when mysql is installed.

*Issue:*
First time I executed *puppet agent -t, *the variable *mysql_version*didn't 
get the value of mysql rpm version. 
But the second time, after mysql is installed. *mysql_version* can 
get the value of mysql rpm version. 

Can anyone help me with the problem? 


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/4uL89crPzDsJ.
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] Variables and autoloading

2012-10-23 Thread Fabrice Bacchella

> On Mon, Oct 22, 2012 at 12:37 PM, jcbollinger  
> wrote:
>   $param1 = 'default1',
>   $param2 = 'default2' ) {
>   # declarations
> }
> 
> I recommend some variation on
> 
> class mymodule::foo {
>   $param1 = hiera('foo::param1', 'default1')
>   $param2 = hiera('foo::param2', 'default2')
>   # declarations
> }

As puppet is changing way of setting parameters every 6 month (and me too, as i 
changed my mind about the best way to do it), I really dislike to put hiera 
usage inside my class definition.

I rather use a configuration class where I can easily change way of settings 
values.

It might look like for example :

class config::module {
$param=mood_of_the_day(something)
}

and then calling
class {'module::foo':
   param =>p config::module::param
}

Using this method I have been able to switch from extdata to hiera in a few 
hours of works.
 

-- 
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: User management

2012-10-23 Thread siva kumar
Dear Sunner, 
 
Good Morning !
 
I am shiva . Right now i m working with Puppet User Management Module. And 
i saw your post the same kind of module i looking for. Its very usefull if 
you share you user module to me, Thanks 
 
Thanks & Regards,
 
Shiva...

On Thursday, November 25, 2010 12:54:50 AM UTC-6, Sunner wrote:

> Hi people.
> After some reading, I think I have some sort of coherent thought about how 
> to handle users and groups, being a first time Puppet user though I figured 
> I'd ask for some criticism before I go ahead. 
>
> I'll use the /modules/user module as per the BP-doc, and store all the 
> users and groups in one file/class.
> Then I'll have two(for now at least) classes in separate files, basically 
> these will be admins and non-admins, and node classes will then inherit 
> these as needed(I expect most nodes will only need the admins and possibly 
> some application accounts).
> Somethingl like so(no I'm not trying to write real puppet code, just a 
> brief description, so I know this won't work as is ;-) : 
>
> virtual.pp
> class user::virtual
> # Groups first for the sake of order
> @group admin...
> @group notadmin...
> ... 
>
> # Users now
> @user {"user1": gid => "admin" ...}
> @user {"user2": gid => "notadmin" ...}
> ... 
>
>
> admins.pp
> class user::admins inherits user::virtual
> realize ( Group["admin"], User["user1"] ) 
>
>
> nonadmins.pp
> class user::notadmins inherits user::virtual
> realize ( Group["notadmin", User["user2"] ) 
>
> And the base node class will include the user::admin class, and so forth.
> As for application accounts and such, I figured I'd stick these in classes 
> of their own in one manifest(say appusers.pp or some such). 
>
> Basically what I'm asking, does this seem sane to more experienced people, 
> or am I setting myself up for pain? 
>
> Regards
> Johan
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/DM5V98czFJgJ.
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] custom type with array property?

2012-10-23 Thread Jakov Sosic
On 10/23/2012 01:47 AM, Stefan Schulte wrote:

> Yeah I also consider this a bug. There is a ticket for the issue though
> http://projects.puppetlabs.com/issues/10237

Yeah that's it! I've added a link as a comment to my type.rb's

Thank you 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-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] Disabling root user

2012-10-23 Thread Christopher Wood
I don't believe you'll be able to remove the root user without massive system 
breakage due to how it's an essential system account. For example, your PID 1 
likely runs as root.

Perhaps try something like this untested fragment, given how the star is 
sometimes used to disable a password:

user { 'root':
password => '*',
}

http://docs.puppetlabs.com/references/latest/type.html#user

On Tue, Oct 23, 2012 at 12:08:59AM -0700, Ben McCann wrote:
>I have some machines running Ubuntu that have a root user on them setup by
>my web host.  I'd like to disable the root user.
>I tried:
>  user { 'root':
>    ensure => absent,
>  }
>But got the error message:
>err: /Stage[main]/Users/User[root]/ensure: change from present to absent
>failed: Could not delete user root: Execution of '/usr/sbin/userdel root'
>returned 8: userdel: user root is currently logged in
>However, I don't believe the root user is logged in.  Is it not possible
>to delete the root user?  Is there something else I should do such as
>disabling its password?
>Thanks,
>Ben
> 
>--
>You received this message because you are subscribed to the Google Groups
>"Puppet Users" group.
>To view this discussion on the web visit
>[1]https://groups.google.com/d/msg/puppet-users/-/VOgfDBb9GuAJ.
>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.
> 
> References
> 
>Visible links
>1. https://groups.google.com/d/msg/puppet-users/-/VOgfDBb9GuAJ

-- 
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] Storeconfig and mcollective using activemq

2012-10-23 Thread Andrew Stangl
RE: puppetdb and pgsql: it all depends on how big your environment is - the 
suggestion for puppetdb is, if you have fewer than 100 nodes, that you use 
the built in haskell/cloujure db - I've ended up doing this, since the env 
is fairly small where we've got this configured, and the storeconfigs were 
painfully slow. I was also disappointed to discover that there's no pgsql 
backend for the dashboard - hopefully this is something that will be 
available soon - there are feature requests in the puppetlabs redmine for 
it. 

Right now, I've installed puppetdb and using the built in db, and I've not 
seen major performance gains with store configs, to be honest ... but 
further profiling seems to be pointing a finger at the speed of file 
serving as opposed to config retrieval via storeconfigs ... just another 
bottleneck in the pain that my puppet setup has become


On Sunday, October 21, 2012 3:59:22 AM UTC+1, Mike Skint wrote:
>
> One reason I wouldn't do this is that the puppet console *only* uses mysql 
> and as I understand it
> puppetdb doesn't support mysql,  I'm not chuffed by the idea of running 
> both..
>
> On Thursday, May 31, 2012 5:03:41 AM UTC-7, Ken Barber wrote:
>>
>> Why don't you try using PuppetDB for stored configs instead? Its 
>> asynchronous, uses activemq behind the scenes and supports postgres. 
>>
>> https://github.com/puppetlabs/puppetdb 
>>
>> On Thu, May 31, 2012 at 10:32 AM, Svein  wrote: 
>> > How can I set up both Storeconfig and mcollective using activemq for 
>> both? 
>> > mcollective should use username and password, but it seems to me that 
>> > storeconfig don't have an option to use user:pw. 
>> > I'm saving the config in an postgres db. 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups 
>> > "Puppet Users" group. 
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msg/puppet-users/-/j6aKTi8PABYJ. 
>> > To post to this group, send email to puppet...@googlegroups.com. 
>> > To unsubscribe from this group, send email to 
>> > puppet-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/9-2K4TjoD3MJ.
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] puppet ca generate --dns-alt-names

2012-10-23 Thread Jonathan Gazeley
I'm trying to generate a CA certificate that will be used on multiple 
puppet masters, accessed by round robin DNS.


The individual nodes have their own hostnames and the round robin name 
is puppet.resnet.bris.ac.uk or puppet.resnet.bristol.ac.uk (the twin 
domain name for Bristol university is historical, and a total pain).


However I'm having trouble with puppet ca as follows:

[jg4461@puppet1 ~]$ sudo puppet ca generate --dns_alt_names 
puppet.resnet.bris.ac.uk

Error: puppet ca generate takes 1 argument, but you gave 0
Error: Try 'puppet help ca generate' for usage

[jg4461@puppet-1 ~]$ sudo puppet ca generate 
--dns_alt_names=puppet.resnet.bris.ac.uk, puppet.resnet.bristol.ac.uk
Error: The certificate retrieved from the master does not match the 
agent's private key.
To fix this, remove the certificate from both the master and the agent 
and then start a puppet run, which will automatically regenerate a 
certficate.

On the master:
  puppet cert clean puppet1.resnet.bris.ac.uk
On the agent:
  rm -f /var/lib/puppet/ssl/certs/puppet1.resnet.bris.ac.uk.pem
  puppet agent -t

[jg4461@puppet1 ~]$ puppet --version
3.0.1


Am I doing something wrong, or is something broken?

Thanks,
Jonathan

--
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] Disabling root user

2012-10-23 Thread joe dhonny
Hi Ben,
Am 23.10.2012 09:08, schrieb Ben McCann:
> However, I don't believe the root user is logged in.  Is it not possible to 
> delete the root user?  Is there something else I should do such as 
> disabling its password?
>
The root user can not be removed.
The default settings on ubuntu are not to let anyone login as root,
unless you configured it otherwise.  See the ubuntu server guide at
https://help.ubuntu.com for details.

hth, joe

-- 
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] Disabling root user

2012-10-23 Thread Ben McCann
I have some machines running Ubuntu that have a root user on them setup by 
my web host.  I'd like to disable the root user.

I tried:
  user { 'root':
ensure => absent,
  }

But got the error message:
err: /Stage[main]/Users/User[root]/ensure: change from present to absent 
failed: Could not delete user root: Execution of '/usr/sbin/userdel root' 
returned 8: userdel: user root is currently logged in

However, I don't believe the root user is logged in.  Is it not possible to 
delete the root user?  Is there something else I should do such as 
disabling its password?

Thanks,
Ben

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/VOgfDBb9GuAJ.
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.