Re: [Puppet Users] Have Class Only Perform Actions When There Is Work To Do (i.e. Making Them Idempotent)

2012-10-29 Thread John Warburton
On 30 October 2012 01:59, jcbollinger  wrote:
> On Friday, October 26, 2012 1:50:53 PM UTC-5, Dave Mankoff wrote:
>>
>> [...] I wanted to avoid package management systems only because they are
>> way more complicated than a basic install of python requires:

> There is a bit of a learning curve for building your own packages,
> multiplied by the number of packaging systems you actually need to deal

https://github.com/jordansissel/fpm

-- 
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] Platform Support at {apt,yum}.puppetlabs.com

2012-10-29 Thread Matthaus Owens
Both apt and yum have old flavors of debian, ubuntu, and fedora which
will be removed shortly. Here is a list of the affected platforms.

Fedora 15 support ended 2012-06-26
Debian 5 (Lenny) support ended 2012-02-06
Ubuntu 10.10 (Maverick) support ended 2012-04-10

In general, we will maintain packages and repositories for platforms
90 days after support for them has ended. This means that, for Ubuntu
11.04 (Natty), whose support just ended yesterday 2012-10-28, we will
remove its associated repository on apt after 2012-01-28.

-- 
Matthaus Owens
Release Manager, Puppet Labs

-- 
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: how to install a module from github

2012-10-29 Thread Kevin G.
On Monday, October 29, 2012 4:38:07 PM UTC-7, Jenner La Fave wrote:
>
> Oh, right. You need to rename /etc/puppet/modules/cron-job/ to cron/
>
> The outermost directory needs to match the module name which needs to be 
> "cron".
>

Aha! That's it, thank you! 

>
> http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html
>

So I went back and peered at that page again and even in retrospect, 
knowing the answer, it was hard to see on there, but there it is, "This 
outermost directory’s name matches the name of the module."  I don't know 
how that could be any clearer, but it's still hard to see.  Well, I gave 
torrancew on github a pull request to add a hint to his README.mk, maybe 
that'll help the next guy with my problem.

Thanks so much!



 

-- 
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/-/hd040zKsWy8J.
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 install a module from github

2012-10-29 Thread Jenner La Fave
Oh, right. You need to rename /etc/puppet/modules/cron-job/ to cron/

The outermost directory needs to match the module name which needs to be 
"cron".

http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html
On Monday, October 29, 2012 4:31:53 PM UTC-7, Kevin G. wrote:
>
> On Monday, October 29, 2012 4:19:11 PM UTC-7, Jenner La Fave wrote:
>>
>> cron::daily is actually a defined resource type, so you need to declare 
>> that resource as opposed to including a class. If you have multiple nodes 
>> that you would like to include the same cron job on, you can write your own 
>> class that declares a cron resources and include that.
>>
>> It's hard to say without knowing what you're trying to do, but something 
>> like this might be a good place to start:
>>
>> class crontest {
>> cron::daily {"test_cron_job":
>> minute  => '0,15,30,45',
>> hour=> '0,12',
>> command => '/usr/bin/derp --foo';
>> }
>> }
>>
>
>  That's what I thought at first, but doing that I get:
>
> Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid 
> resource type cron::daily
>
>
> so I figured I needed to include the file first. 
>
> Am I still missing something?
>
>

-- 
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/-/uJi7xYKnRikJ.
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] intercept/pre-process cert request?

2012-10-29 Thread Lou
I'm assuming this is possible, but I can't find a good starting point 
anywhere, so I'm hoping someone here can help. What I want to do is, 
somewhere in the cert approval process, run an extra check before saying 
yes.

I have a puppet master running with auto sign turned on, I bring up a 
puppet agent, it connects, authenticates and all is good. What I'd like to 
do is intercept the request from the agent on the master and run a 
programmatic check against the calling agent's IP addr before approving or 
denying the request.

Is this even possible, and if so, how do I accomplish it? Even pointers to 
the code that gets executed would help, but I'd really like to avoid 
mucking with the ca code itself and just add something in the chain. 
Filtering on domain in autosign.conf is not sufficient.

thanks,

Lou

-- 
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/-/TRHdTAzsYtQJ.
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 install a module from github

2012-10-29 Thread Kevin G.
On Monday, October 29, 2012 4:19:11 PM UTC-7, Jenner La Fave wrote:
>
> cron::daily is actually a defined resource type, so you need to declare 
> that resource as opposed to including a class. If you have multiple nodes 
> that you would like to include the same cron job on, you can write your own 
> class that declares a cron resources and include that.
>
> It's hard to say without knowing what you're trying to do, but something 
> like this might be a good place to start:
>
> class crontest {
> cron::daily {"test_cron_job":
> minute  => '0,15,30,45',
> hour=> '0,12',
> command => '/usr/bin/derp --foo';
> }
> }
>

 That's what I thought at first, but doing that I get:

Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid 
resource type cron::daily


so I figured I needed to include the file first. 

Am I still missing something?

-- 
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/-/DytFQBF-C1wJ.
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 install a module from github

2012-10-29 Thread Jenner La Fave
cron::daily is actually a defined resource type, so you need to declare 
that resource as opposed to including a class. If you have multiple nodes 
that you would like to include the same cron job on, you can write your own 
class that declares a cron resources and include that.

It's hard to say without knowing what you're trying to do, but something 
like this might be a good place to start:

class crontest {
cron::daily {"test_cron_job":
minute  => '0,15,30,45',
hour=> '0,12',
command => '/usr/bin/derp --foo';
}
}

On Monday, October 29, 2012 4:03:30 PM UTC-7, Kevin G. wrote:
>
> I seem to be missing something.  I've copied the files from this module 
> https://github.com/torrancew/puppet-cron into my modulepath
>
> $ puppet master --configprint modulepath 
> /etc/puppet/modules:/usr/share/puppet/modules
>
>
> so it looks like this:
>
> /etc/puppet/modules/cron-job/
> /etc/puppet/modules/cron-job/manifests/
> /etc/puppet/modules/cron-job/manifests/daily.pp
> /etc/puppet/modules/cron-job/manifests/hourly.pp
> /etc/puppet/modules/cron-job/manifests/init.pp
> /etc/puppet/modules/cron-job/manifests/install.pp
> /etc/puppet/modules/cron-job/manifests/job.pp
> /etc/puppet/modules/cron-job/manifests/monthly.pp
> /etc/puppet/modules/cron-job/manifests/weekly.pp
> /etc/puppet/modules/cron-job/templates/
> /etc/puppet/modules/cron-job/templates/job.erb
>
>
> AFAICT from the docs I should be able to do just this in my own manifests
>
> include daily
>
>  
> but all I get is
>
> Could not find class daily
>
>
> What am I doing wrong?
>

-- 
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/-/rC-QLmUwnFEJ.
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 install a module from github

2012-10-29 Thread Kevin G.
I seem to be missing something.  I've copied the files from this 
module https://github.com/torrancew/puppet-cron into my modulepath

$ puppet master --configprint modulepath 
/etc/puppet/modules:/usr/share/puppet/modules


so it looks like this:

/etc/puppet/modules/cron-job/
/etc/puppet/modules/cron-job/manifests/
/etc/puppet/modules/cron-job/manifests/daily.pp
/etc/puppet/modules/cron-job/manifests/hourly.pp
/etc/puppet/modules/cron-job/manifests/init.pp
/etc/puppet/modules/cron-job/manifests/install.pp
/etc/puppet/modules/cron-job/manifests/job.pp
/etc/puppet/modules/cron-job/manifests/monthly.pp
/etc/puppet/modules/cron-job/manifests/weekly.pp
/etc/puppet/modules/cron-job/templates/
/etc/puppet/modules/cron-job/templates/job.erb


AFAICT from the docs I should be able to do just this in my own manifests

include daily

 
but all I get is

Could not find class daily


What am I doing wrong?

-- 
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/-/UumLCdAWIYwJ.
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: bootstrap aws instance - set server address in instance puppet.conf?

2012-10-29 Thread Martijn
Here's another option for people who are not using Puppet Cloud 
Provisioner, but for example EC2's autoscaling or launching test-instances 
by hand.:

Ubuntu and Amazon Linux images include a tool called CloudInit, which makes 
it easy to perform bootstrapping tasks on a new instance. It's built into 
the official images.

You provide scripts in the 'user-data' metadata that you enter when you 
launch an instance. CloudInit takes that input and runs it. It's quite 
versatile, supporting various formats such as shell-scripts, cloud-config 
yaml, upstart jobs, content downloaded from URLs, compressed and 
mime-multipart content, etc. 
See https://help.ubuntu.com/community/CloudInit for docs 
and 
http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/files/head:/doc/examples/
 
for some examples.

We enter something like the following in the user-data metadata to 
bootstrap our Puppet nodes. The %i is replaced with the instance-id by 
Cloud-Init, to generate a unique certname. That's all that's needed to 
bootstrap from a default Ubuntu image to a puppet node.

#cloud-config
apt_update: true
apt_upgrade: true
packages:
- puppet
puppet:
  conf:
agent:
  server: "puppet.example.com"
  certname: "%i.web.cluster1.ec2"
  pluginsync: "true"


Regards, Martijn Heemels

Op maandag 2 juli 2012 22:58:28 UTC+2 schreef Leej het volgende:
>
> Hello, new user here. I'm trying to bootstrap an aws instance and need to 
> change the server setting in puppet.conf on the client/instance that is 
> created. Is there anyway to do this beyond modifying hosts post-hoc?
>
> puppet node_aws bootstrap --image ami-e1e8d395 --keyname mykey --login 
> ubuntu --keyfile ~mykeyfile.pem --puppetagent-certname aws_server_test 
> --region=eu-west-1 --type t1.micro -g webserver 
>
> This provisions an instance but fails to register a cert request on the 
> puppetmaster with :
>
> notice: Puppet is now installed on: 
> blahblah.eu-west-1.compute.amazonaws.com
> notice: No classification method selected
> notice: Signing certificate ...
> err: Signing certificate ... Failed
> err: Signing certificate error: Could not render to pson: getaddrinfo: 
> Name or service not known
>
> Checking the instances puppet.conf shows that the server config variable 
> is set to "puppet" which I want to change to "myserver.somewhere.com". 
> Now I dont know if this behaviour is a bug, I would have thought that since 
> I'm running puppet from the master server, bootstrapping should be able to 
> update the server variable correctly or there should at least be a command 
> line option.
>
> I know I can run a script at somepoint and modify my hosts files but I'm 
> trying to keep things automated and simple. What am I missing?
>
> I should also note, if I ssh into the created instance I can modify the 
> puppet.conf file with the correct server name and a certificate request is 
> issued which I can then sign.
>
> Any help.best practices greatly appreciated - lj.
>

-- 
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/-/TL2I777bKeYJ.
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] help with scoping variable into a template

2012-10-29 Thread mparrad
Hi guys, 

I'm working on puppet for windows, and now I have to work on a template 
that use the value from a variable set it on a class, the problem that i 
got is always I got undef value on the result file.
I checked this URL without no results 
http://stackoverflow.com/questions/10589404/puppet-cant-find-variable-for-template

These are my classes variables:

class direct::config () {

require direct::setup

$nameSite = 'some.site.com'
..
}

and this where I use it on my template locate on 
direct/templates/conf/css.erb:
.
DomainIP <%= @ipaddress %>,127.0.0.1
DefServerName <%= scope.lookupvar("direct::config::nameSite") %>
.
.


And the file results css.cfg:
.
DomainIP 10.10.10.23,127.0.0.1
DefServerName undefined
.
.

I expected DefServerName some.site.com

Could you help me with this issue? What Am I doing wrong?

Thank you in advance...

Best Regards.

-- 
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/-/-2FK6mx9ESQJ.
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 3.0 rspec and custom resources

2012-10-29 Thread Nathan Huff
Looks like the subnamespace thing isn't important either.  Just having two 
classes triggers this as well.

On Monday, October 29, 2012 1:13:05 PM UTC-5, Nathan Huff wrote:
>
> OK so I have what I think is a minimal test case here:
>
> https://github.com/nhuff/spec-failure
>
> The readme has a list of gems I have installed in it.
>
> You seem to need spec tests for two classes, one of which is in a sub 
> namespace of the other.
> In this case 'test' and 'test::c'.  With both spec files in place the 
> system complains about anchor not being defined.
> If you remove the test file for test::c the test for class test will pass.
>

-- 
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/-/FO2lFrl_wjYJ.
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] RHEL 6 Protected multilib versions Requirment to have both 32 and 64 bit libs installed.

2012-10-29 Thread Tim Mooney

In regard to: [Puppet Users] RHEL 6 Protected multilib versions Requirment...:


(/Stage[main]/Libstdc/Package[libstdc++.i686]/ensure) change from absent to
present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install
libstdc++.i686' returned 1: Error: Protected multilib versions:
libstdc++-4.4.6-4.el6.i686 != libstdc++-4.4.6-3.el6.x86_64#012 You could
try using --skip-broken to work around the problem#012 You could try
running: rpm -Va --nofiles --nodigest

the .pp :

class libstdc {

Class["rhn"]->Class["libstdc"]


Are you really intending to have Class['rhn'] applied *before*
Class['libstdc'], because that's what your arrow chaining says.  I would
assume you're trying to install both archs because RHN Satellite needs
both but doesn't have the 32 bit version as an explicit dependency.
If that's the case, you should swap what side of the -> the two classes
are on.


package { "libstdc++.i686":
ensure => installed,
}

package { "libstdc++":
ensure => installed,
}


As John said, your best bet is to get the 32 bit version installed
because of a dependency of something else.  It's frankly ridiculous
that Red Hat provides a product that doesn't do this correctly, but
we can work around that, even without having to try repackage RHN
Satellite.

This can be done very easily by creating a package that contains no files
at all, but lists other packages as requirements.  The trick is to have
empty %prep/%build/%install/%files sections of your spec file, but list
either

- package names
- exact shared library SONAMES
- (as a last resort) full paths to a file or library

in the "Requires:" entries for the RPM.  An example spec file you might
start with to build an RPM is included after my signature.  You would
just need a RHEL box with the 'rpm-build' package installed, something
like

rpmbuild -ba -v rhn-satellite-32bit-deps.spec

and then you put that package in your local repo and have puppet

package { 'rhn-satellite-32bit-deps':
ensure => installed,
}

This virtual package then pulls in whatever dependencies you have listed.

Tim
--
Tim Mooney tim.moo...@ndsu.edu
Enterprise Computing & Infrastructure  701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164



Summary: pull in the 32 bit dependencies for RHN Satellite
Name: rhn-satellite-32bit-deps
Version: 1.0
Release: 1
Group: Local/Whatever
License: Copyright (C) your organization here
URL: http://yourcompany/whatever/you/want/here
Vendor: Your Company and possibly OU here
Distribution: Your distribution name here

#
# Preference #1: require package names, like "make" or "kernel-headers"
# 
#Requires:


#
# If you need specific SONAME and arch for a library, that can be
# accomplished like this
#
# the 32 bit version
Requires: libstdc++.so.6
# the 64 bit version
#Requires: libstdc++.so.6()(64bit)


#
# Last resort, only use if others don't work: specify a full path to the file
# that some other RPM should be installing.  This can generally be
# accomplished better by using a package name instead.
#
#Requires: /usr/bin/bash

%description
This package contains no files.  It exists solely to specify other
packages that should be installed when this virtual package is installed.

%prep
# no software to extract and prepare for compilation
exit 0

%build
# nothing to build
exit 0

%install
# nothing to install
exit 0

%files
# no files contained in this RPM.

--
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 3.0 rspec and custom resources

2012-10-29 Thread Nathan Huff
OK so I have what I think is a minimal test case here:

https://github.com/nhuff/spec-failure

The readme has a list of gems I have installed in it.

You seem to need spec tests for two classes, one of which is in a sub 
namespace of the other.
In this case 'test' and 'test::c'.  With both spec files in place the 
system complains about anchor not being defined.
If you remove the test file for test::c the test for class test will pass.

On Monday, October 29, 2012 10:36:50 AM UTC-5, Nathan Huff wrote:
>
> A super simple module that just has a file and anchor resources works fine 
> so it isn't that things aren't getting loaded at all.  I am going to start 
> ripping things out of my more complex module and see if I can track down 
> the trigger.
>
> On Friday, October 26, 2012 5:35:07 PM UTC-5, Jeff McCune wrote:
>>
>> Hrmmm. 
>>
>> Is there a small rspec example you could post that reproduces this 
>> issue?  I'd love to try and reproduce it since there's definitely a 
>> possibility that a change between Puppet 2.7 and 3.0 is responsible 
>> for this issue. 
>>
>> -Jeff 
>>
>> On Fri, Oct 26, 2012 at 8:01 AM, Nathan Huff  
>> wrote: 
>> > I am trying to figure out if I am missing something simple here.  After 
>> > upgrading to puppet 3.0 running puppet-rspec tests that use 
>> > custom resources from modules in the fixtures directory are failing.  I 
>> have 
>> > a module that uses the anchor type and with 2.7.19 it works fine. 
>> > After upgrading to 3.0 all of the tests are failing with 
>> > 
>> > Puppet::Error: 
>> >Puppet::Parser::AST::Resource failed with error ArgumentError: 
>> > Invalid resource type anchor at 
>> > 
>> /home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp:2 
>> on 
>> > node enyo.localhost 
>> > 
>> > The debug output is 
>> > Debug: importing 
>> > '/home/nrhuff/repos/puppet-os/spec/fixtures/manifests/site.pp' in 
>> > environment production 
>> > Debug: importing 
>> > 
>> '/home/nrhuff/repos/puppet-os/spec/fixtures/modules/stdlib/manifests/init.pp'
>>  
>>
>> > in environment production 
>> > Debug: Automatically imported stdlib from stdlib into production 
>> > Debug: importing 
>> > 
>> '/home/nrhuff/repos/puppet-os/spec/fixtures/modules/stdlib/manifests/stages.pp'
>>  
>>
>> > in environment production 
>> > Debug: Automatically imported stdlib::stages from stdlib/stages into 
>> > production 
>> > Debug: importing 
>> > 
>> '/home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp' 
>> in 
>> > environment production 
>> > Debug: Automatically imported os from os into production 
>> > Error: Puppet::Parser::AST::Resource failed with error ArgumentError: 
>> > Invalid resource type anchor at 
>> > 
>> /home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp:2 
>> on 
>> > node enyo.localhost 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/resource.rb:218:in
>>  
>>
>> > `initialize' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/resource.rb:120:in
>>  
>>
>> > `initialize' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:44:in
>>  
>>
>> > `new' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:44:in
>>  
>>
>> > `evaluate' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/util/errors.rb:35:in
>>  
>>
>> > `exceptwrap' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:43:in
>>  
>>
>> > `evaluate' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:42:in
>>  
>>
>> > `collect' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:42:in
>>  
>>
>> > `evaluate' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/module.rb:283:in
>>  
>>
>> > `collect' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/branch.rb:16:in
>>  
>>
>> > `each' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/branch.rb:15:in
>>  
>>
>> > `each' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:25:in
>>  
>>
>> > `collect' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:25:in
>>  
>>
>> > `evaluate' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
>>  
>>
>> > `safeevaluate' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:25:in
>>  
>>
>> > `evaluate' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
>>  
>>
>> > `each' 
>> > 
>> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
>>  
>>
>> > `eva

[Puppet Users] help with creating self.instances for puppetlabs-lvm providers

2012-10-29 Thread Corey Osman

Hi,

I have been adding support for the puppetlabs-lvm module so that I can use 
puppet resource .

I have most of the coding done but can't seem to get certain parameters in the 
output.


https://github.com/logicminds/puppetlabs-lvm/commit/deb258231f5a4dc6da7c0d65a7153846b8766b3e


example:

def self.instances
  filesystems.map { | fs |
 new(:name => fs[0], :fs_type => fs[1], :options => fs[2], 
:ensure => :present ) }
end



[root@puppet2 logical_volume]# puppet resource filesystem

filesystem { '/dev/mapper/vg_puppet2-lv_root':
  ensure => 'present',
}
filesystem { '/dev/sda1':
  ensure => 'present',
}



The output should detail the fstype and options but I don't know why it doesn't 
output these details.  I have similar issues with other types so I must be 
missing something in my code.

Should look like this:

filesystem { '/dev/sda1':
  ensure => 'present',
  options => "-b 4096",
  fs_type => "ext4",
}


One other thing I found is that its necessary to reference @property_hash in 
order for puppet resource logical_volume to work since the default @resource is 
missing certain keys.

 rname ||= @resource[:name] || @property_hash[:name]

Not sure why I need to reference @property_hash?


Also,

How do I add tests for puppet resource?  Any examples?


BTW, I am adding this code so that I can validate that puppet did what it was 
supposed to do without writing custom parsers and formatters (Thats what puppet 
is for".  



Thanks,

Corey Osman
co...@logicminds.biz
Green IT and Data Center Automation Specialist






-- 
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: hiera broken in puppet-3

2012-10-29 Thread asq
ok, i got it working with this patch: 
https://github.com/Fewbytes/puppet/commit/71d9449464d5f10042b9cc31aea1586f98363293
however, if i apply the rest of this PR it breaks again. so beware :)

-- 
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/-/iOiOln1U40kJ.
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] Connection Timed Out updating node on 3g mobile broadband device

2012-10-29 Thread Steve
The fix was lowering the MTU.

I ran ifconfig ppp0 mtu 1000 and puppet runs without any problem.

I didn't think this fixed it in my last post because I made some changes on 
the puppet master. Once I fixed those changes I lowered the MTU and it 
works!!





On Friday, October 26, 2012 11:05:40 AM UTC-4, Steve wrote:
>
> I was able to telnet port 8140 via the 3g connection.
>
> I also tried to lower the MTU on the interface and I was still 
> unsuccessful. So I set it back
>
> One thing I don't understand is that the error message has now changed to 
>
> err: Could not retrieve catalog from remote server: Connection reset by 
> peer - SSL_connect
> warning: Not using cache on failed catalog
> err: Could not retrieve catalog; skipping run
> err: Could not send report: Connection reset by peer - SSL_connect
>
>
> I am going to try the timeout setting in the module, but the only module I 
> have running is one that checks to see if a particular service is running.
>
>
>
>
> On Thursday, October 25, 2012 5:09:35 PM UTC-4, denmat wrote:
>>
>> Interesting setup. Sometimes providers block uncommon ports. Can you get 
>> to 8140 over your 3/4g? If not, try running on 443 (change puppet.conf or 
>> apache ports).
>>
>> If none of these work check the docs for timeout settings (can't remember 
>> of hand).
>>
>> Den
>>
>> On 26/10/2012, at 3:55, Steve  wrote:
>>
>> I have a puppetmaster on an Amazon EC2 instance of Ubuntu 12.04. All of 
>> the puppet nodes I am running are also on ubuntu server 12.04. I can 
>> connect any of the nodes on a wireless or LAN connection. When I switch my 
>> node to a Verizon mobile 3g or 4g device I run "puppet agent -t" and I get 
>> the message
>>
>> err: Could not retrieve catalog from remote server: Connection time out - 
>> SSL_connect
>> warning: Not using cache on failed catalog
>> err: Could not retrieve catalog; skipping run
>> err: Could not send report: Connection timed out - SSL_connect
>>
>> Before I got the message there was a long pause about 20 minutes long 
>> trying to do the update.
>>
>> I can download and install packages with the 3g connection using apt-get 
>> install. I can access webpages including secure pages using Lynx. I can 
>> ping the Puppet Master.
>>
>> I wanted to make sure I was getting through to the Puppet Master so I 
>> removed the certificate from both the Puppet Master and the Client. Then I 
>> ran "puppet agent -t" and the certificate was signed and I can see it again 
>> on the Puppet Master and the client. 
>>
>> I checked port 8140 to see that it is open in Amazon, and it is. There is 
>> no firewall enabled in the instance itself.
>>
>> Next I limited the puppet update to only one trivial module and nothing 
>> changed.
>>
>> Lastly, I connected a node that is on a desktop version of Ubuntu 12.10 
>> and connected my Verizon device. I had the similar behavior. The system 
>> paused for 10 to 20 minutes like before then gave me the message:
>>
>> Error: Failed to apply catalog: execution expired
>> Error: Could not send report: execution expired
>>
>> Since I have little experience with puppet or these devices, I suspect 
>> the device has some sort of interrupt or time out on the device that causes 
>> problems with the puppet process.
>>
>> Anyways as far as I can tell the only thing I cannot do with this 
>> connection is update puppet.
>>
>> -- 
>> 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/-/PHNcXaR-TyAJ.
>> 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/-/aEol4z0XBgUJ.
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] multiple puppetmasters, single ca

2012-10-29 Thread Jeff McCune
On Sun, Oct 28, 2012 at 9:53 PM, ryan wallner  wrote:

> HI all,
>
> I am currently setting up a HA devops configuration using puppet. I want
> to be able to run a single puppet master as the CA and the rest act as
> peering puppet masters. I have each puppet master running on passenger and
> I am proxying the SSL requests to the CA server following:
>
> http://docs.puppetlabs.com/**guides/scaling_multiple_**
> masters.html#option-2-**redirect-certificate-traffic
> http://docs.puppetlabs.com/**guides/passenger.html
>
> as a reference.
>
> Watching the access.log on each master, when an agent requests a cert from
> a puppetmaster that is *not* the CA, I can see the request forwarded:
> (below)
>
> .4 is the agent
> .3 us the master proxying the request
> puppetca is the acting CA for all masters
>

> *Here is the what logs in access.log for the puppetmaster that is NOT the
> CA.*
> ubuntu-pupmaster1:8140 192.168.192.4 - - [26/Oct/2012:15:32:36 -0400] "GET
> /production/certificate/agent-**hostname? HTTP/1.1" 200 2245 "-" "-"
>
> *Here is what logs in the master which IS the CA*
> puppetca:8140 192.168.192.3 - - [26/Oct/2012:15:32:33 -0400] "GET /" 400
> 588 "-" "-"
>

I notice you're running the CA on port 8140.  Are you running the CA
back-end using SSL?  If so, you probably shouldn't be.

If you use TCP load balancing, then all of your back end workers will
terminate the SSL connection.  If, however, your load balancer terminates
the SSL connection, then your back end workers need to deal with plaintext
HTTP.

I suspect the problem you're running into is that the service forwarding
the request to the CA is not using a SSL certificate.

Alternatively, you could try changing BalancerMember
http://puppetcamaster:8140 to BalancerMember
https://puppetcamaster:8140and see if that helps.  (Note the https).

-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] how to intercept a catalog and perform a diff

2012-10-29 Thread Henrik Lindberg

On 2012-29-10 16:25, Kevin G. wrote:

I'm re-reading the puppet docs
http://docs.puppetlabs.com/learning/manifests.html and just noticed this
footnote

  If you drastically refactor your manifest code and want to make sure
it still generates the same configurations,
you can just intercept the catalogs and use a special diff tool on them;

but the footnote doesn't say how to do that or point to any
documentation. I've been looking for a way to do exactly that for some
time now and haven't succeeded in finding it, can anyone point me to
documentation or give me a list of simple steps to "intercept a catalog"
or what this "special diff tool" would be?



There is also a catalog diff available in Cloudsmih't Stackhammer online 
tool. Checkout http://www.cloudsmith.com


Regards
- henrik


--
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 3.0: Not authorized to call find on /file_metadata, more issues?

2012-10-29 Thread Esther Hanko
Does anyone remember the following deprecation warning:

 

"DEPRECATION NOTICE: Files found in modules without specifying 'modules' in
file path will be deprecated in the next major release.  Please fix module
'zabbix_agent' when no 0.24.x clients are present"

 

I believe I had the same problem you are having now, and the solution was to
follow the above advise and add 'modules' to the file sources.

 

Hope this helps you too.

 

-Esther

 

From: puppet-users@googlegroups.com [mailto:puppet-users@googlegroups.com]
On Behalf Of Forrie
Sent: woensdag 24 oktober 2012 23:41
To: puppet-users@googlegroups.com
Subject: Re: [Puppet Users] Re: Puppet 3.0: Not authorized to call find on
/file_metadata, more issues?

 

I applied the fixes to my test/staging config and it's not very happy.   I
think I'll just wait for the official fix to be out before I move forward
with 3.x. :-)

 

For giggles, here's the log:

 

# puppet agent --test

Ignoring --listen on onetime run

 

Warning: Unable to fetch my node definition, but the agent run will
continue:

Warning: Error 403 on SERVER: Forbidden request:
stage1.myserver.com(127.0.0.1) access to /node/stage1.myserver.com [find]
authenticated  at :102

 

Info: Retrieving plugin

 

Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources
using 'eval_generate: Error 403 on SERVER: 

 

Forbidden request: stage1.myserver.com(127.0.0.1) access to
/file_metadata/plugins [search] authenticated  at :102

 

Error: /File[/var/lib/puppet/lib]: Could not evaluate: Error 403 on SERVER:
Forbidden request: stage1.myserver.com(127.0.0.1) access to
/file_metadata/plugins [find] authenticated  at :102 Could not retrieve file
metadata for puppet://stage1.myserver.com/plugins: Error 403 on SERVER:
Forbidden request: stage1.myserver.com(127.0.0.1) access to
/file_metadata/plugins [find] authenticated  at :102

 

Info: Caching catalog for stage1.myserver.com

Info: Applying configuration version '1351113815'

 

Error: /Stage[main]/Ntp-client/File[/etc/ntp.conf]: Could not evaluate:
Error 403 on SERVER: Forbidden request: stage1.myserver.com(127.0.0.1)
access to /file_metadata/etc/ntp.conf [find] authenticated  at :102 Could
not retrieve file metadata for puppet:///etc/ntp.conf: Error 403 on SERVER:
Forbidden request: stage1.myserver.com(127.0.0.1) access to
/file_metadata/etc/ntp.conf [find] authenticated  at :102

/Stage[main]/Ntp-client/Service[ntpd]: Dependency File[/etc/ntp.conf] has
failures: true

 

Warning: /Stage[main]/Ntp-client/Service[ntpd]: Skipping because of failed
dependencies

 

 

 

 

Everything under /var/lib/puppet was created by the puppetmaster --
/var/lib/puppet/lib is owned by root:root as it is on my /working/ puppet
master.  

 

[ fileserver.conf ]

 

[files]

path /etc/puppet/files

allow *

 

[ auth.conf ]

 

path ~ ^/file_(metadata|content)/files/

auth yes

allow /^(.+\.)?example.com$/

allow_ip 10.101.0.0/24

allow_ip 10.103.0.0/24

allow_ip 127.0.0.0/24

 

I tried the last one, 127/24, to see if the issue was with the client
connecting locally; made no difference.

 

Everything else in auth.conf is "allow *"

 

We have a set of files in /etc/puppet/files/etc/blah-blah that are copied
over to the clients.  They are not in a module (don't need to be).   I read
somewhere that you need to put your files in the modules that belong to
them, this doesn't apply here as far as I can tell.

 

In any case... that's all going off on a tangent.I hope the fix will be
out soon :-)

 

 

Thanks.

 

-- 
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/-/cx8NwigZpBAJ.
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] Puppet 3.0 rspec and custom resources

2012-10-29 Thread Nathan Huff
A super simple module that just has a file and anchor resources works fine 
so it isn't that things aren't getting loaded at all.  I am going to start 
ripping things out of my more complex module and see if I can track down 
the trigger.

On Friday, October 26, 2012 5:35:07 PM UTC-5, Jeff McCune wrote:
>
> Hrmmm. 
>
> Is there a small rspec example you could post that reproduces this 
> issue?  I'd love to try and reproduce it since there's definitely a 
> possibility that a change between Puppet 2.7 and 3.0 is responsible 
> for this issue. 
>
> -Jeff 
>
> On Fri, Oct 26, 2012 at 8:01 AM, Nathan Huff 
> > 
> wrote: 
> > I am trying to figure out if I am missing something simple here.  After 
> > upgrading to puppet 3.0 running puppet-rspec tests that use 
> > custom resources from modules in the fixtures directory are failing.  I 
> have 
> > a module that uses the anchor type and with 2.7.19 it works fine. 
> > After upgrading to 3.0 all of the tests are failing with 
> > 
> > Puppet::Error: 
> >Puppet::Parser::AST::Resource failed with error ArgumentError: 
> > Invalid resource type anchor at 
> > 
> /home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp:2 
> on 
> > node enyo.localhost 
> > 
> > The debug output is 
> > Debug: importing 
> > '/home/nrhuff/repos/puppet-os/spec/fixtures/manifests/site.pp' in 
> > environment production 
> > Debug: importing 
> > 
> '/home/nrhuff/repos/puppet-os/spec/fixtures/modules/stdlib/manifests/init.pp' 
>
> > in environment production 
> > Debug: Automatically imported stdlib from stdlib into production 
> > Debug: importing 
> > 
> '/home/nrhuff/repos/puppet-os/spec/fixtures/modules/stdlib/manifests/stages.pp'
>  
>
> > in environment production 
> > Debug: Automatically imported stdlib::stages from stdlib/stages into 
> > production 
> > Debug: importing 
> > 
> '/home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp' 
> in 
> > environment production 
> > Debug: Automatically imported os from os into production 
> > Error: Puppet::Parser::AST::Resource failed with error ArgumentError: 
> > Invalid resource type anchor at 
> > 
> /home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp:2 
> on 
> > node enyo.localhost 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/resource.rb:218:in
>  
>
> > `initialize' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/resource.rb:120:in
>  
>
> > `initialize' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:44:in
>  
>
> > `new' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:44:in
>  
>
> > `evaluate' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/util/errors.rb:35:in
>  
>
> > `exceptwrap' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:43:in
>  
>
> > `evaluate' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:42:in
>  
>
> > `collect' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:42:in
>  
>
> > `evaluate' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/module.rb:283:in
>  
>
> > `collect' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/branch.rb:16:in
>  
>
> > `each' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/branch.rb:15:in
>  
>
> > `each' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:25:in
>  
>
> > `collect' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:25:in
>  
>
> > `evaluate' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
>  
>
> > `safeevaluate' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:25:in
>  
>
> > `evaluate' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
>  
>
> > `each' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
>  
>
> > `evaluate' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
>  
>
> > `safeevaluate' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/resource/type.rb:136:in
>  
>
> > `evaluate_code' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/resource.rb:81:in
>  
>
> > `evaluate' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb
>  
>
> > :165:in `evaluate_classes' 
> > 
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:150:in
>  
>
> > `each' 
> > 
> /home/nrhuff/.rvm/gems/ruby

Re: [Puppet Users] how to intercept a catalog and perform a diff

2012-10-29 Thread R.I.Pienaar


- Original Message -
> From: "Kevin G." 
> To: puppet-users@googlegroups.com
> Sent: Monday, October 29, 2012 3:25:08 PM
> Subject: [Puppet Users] how to intercept a catalog and perform a diff
> 
> I'm re-reading the puppet docs
> http://docs.puppetlabs.com/learning/manifests.html and just noticed
> this footnote
> 
> If you drastically refactor your manifest code and want to make sure
> it still generates the same configurations,
> you can just intercept the catalogs and use a special diff tool on
> them;
> 
> but the footnote doesn't say how to do that or point to any
> documentation. I've been looking for a way to do exactly that for
> some time now and haven't succeeded in finding it, can anyone point
> me to documentation or give me a list of simple steps to "intercept
> a catalog" or what this "special diff tool" would be?

if you are on puppet 3 you can install the ripienaar-catalog_diff module
from the forge and then use the 'puppet catalog diff' command.

-- 
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] how to intercept a catalog and perform a diff

2012-10-29 Thread Brice Figureau
On Mon, 2012-10-29 at 08:25 -0700, Kevin G. wrote:
> I'm re-reading the puppet docs
> http://docs.puppetlabs.com/learning/manifests.html and just noticed
> this footnote
> 
>  If you drastically refactor your manifest code and want to make sure
> it still generates the same configurations, 
> you can just intercept the catalogs and use a special diff tool on
> them;
> 
> 
> but the footnote doesn't say how to do that or point to any
> documentation. I've been looking for a way to do exactly that for some
> time now and haven't succeeded in finding it, can anyone point me to
> documentation or give me a list of simple steps to "intercept a
> catalog" or what this "special diff tool" would be?

You can check this awesome tool by RI:
https://github.com/ripienaar/puppet-catalog-diff

It's now available as a Forge module, which should even more help using
it.

It produces a report that lists the differences between catalogs
(old/new resources, and differences between changed resources).

It is specifically useful when upgrading a puppet master to a new
version to spot differences in behavior.
-- 
Brice Figureau
Follow the latest Puppet Community evolutions on www.planetpuppet.org!

-- 
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] how to intercept a catalog and perform a diff

2012-10-29 Thread Kevin G.
I'm re-reading the puppet docs 
http://docs.puppetlabs.com/learning/manifests.html and just noticed this 
footnote

 If you drastically refactor your manifest code and want to make sure it 
still generates the same configurations, 
you can just intercept the catalogs and use a special diff tool on them;

but the footnote doesn't say how to do that or point to any documentation. 
I've been looking for a way to do exactly that for some time now and 
haven't succeeded in finding it, can anyone point me to documentation or 
give me a list of simple steps to "intercept a catalog" or what this 
"special diff tool" would be?




-- 
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/-/gi_Wx8EpmqIJ.
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] Have Class Only Perform Actions When There Is Work To Do (i.e. Making Them Idempotent)

2012-10-29 Thread jcbollinger


On Friday, October 26, 2012 1:50:53 PM UTC-5, Dave Mankoff wrote:
>
> [...] I wanted to avoid package management systems only because they are 
> way more complicated than a basic install of python requires:
>
>   wget python.tgz
>   tar -xzvf python.tgz
>   cd python
>   ./configure --prefix=/install/path
>   make
>   make test
>   make install
>
> I wanted to make (I have made?) a simple "python" class that accepts a 
> python version number, downloads it, and runs those steps, irrespective of 
> the base Linux flavor. I don't know much of anything about deb or rpm files 
> other than that they are more complicated than that; and I don't want to 
> have to package up and maintain several different python versions for 
> several different package managers. 
>


And I am startled that you actually *want* to install anything on your 
systems without using your package manager.  Aside from making it pretty 
darn easy to install software, your package manager makes it easy to

   - know what software is installed, including for automated tools such as 
   Puppet,
   - ensure that your software's dependencies are installed, and 
*remain*installed,
   - have your software automatically installed as a dependency of other 
   software,
   - know what files belong to each package, and identify files that don't 
   belong to any package,
   - ensure that every install of your software is the same (to the extent 
   that the same package is used everywhere)
   - prevent conflicts between packages,
   - cleanly remove everything that belongs to a package (init scripts? man 
   pages? documentation? config files? you can't in general rely on everything 
   to be in the same place)
   - optionally, to automate additional management tasks that should attend 
   installation / upgrade / removal of the software
   - avoid having development tools installed on most systems
   
I've probably missed a couple.  Software packaging is a *major* win, very 
much offsetting the cost of building your own packages where you need to do 
so.

There is a bit of a learning curve for building your own packages, 
multiplied by the number of packaging systems you actually need to deal 
with, but it's really not that hard.  If you're just packaging a different 
version of something for which your distro already provides packages, then 
as Tim said, you can probably get away with just making a few changes to 
the existing packaging instructions.


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/-/xwVMIK40LJYJ.
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: creating a list of files from an external define

2012-10-29 Thread jcbollinger


On Sunday, October 28, 2012 8:23:30 AM UTC-5, danielt wrote:
>
> The definition doesn't need to be in its own module, but it should be in 
>> its own *file* within the module (which is what puppet-lint was telling 
>> you),
>>
>
> I know but having a definition which just copys files in a global name 
> space would immensely reduce the amount of code duplication. I actually do 
> not want to have the files definition in every module, I rather want to 
> have my helper module which does that for me.
>
> I hope you understood my intension of doing that.
>
>
That's not relevant to my answer.  Nevertheless, inasmuch as there is 
nothing special about defined types relative to built-in resources when it 
comes to arrays as resource titles, I'm not sure I agree that there is an 
immense amount of code duplication to be saved.  How is using an 
intermediary definition better than just writing this:

file { ${files}:
  ensure   => present,
  owner=> root,
  group=> root,
  mode => 0644,
  source   => 'puppet:///files/apache2/',
  require  => File[$folders],
}

Note 1: "ensure => present" is likely not what you really want, but that's 
what your definition does.

Note 2: you might well not need that 'require' parameter, as Puppet will 
autorequire the parent directory of any managed file if the parent is 
itself managed.

Note 3: if it's the owner / group / mode that you don't want to duplicate, 
then you might want to consider the advantages of being explicit about what 
you want.  If you still want to avoid expressing those explicitly (and how 
many places are we talking about, really?) then you could consider setting 
global defaults for those parameters:

site.pp
---
# ...
File {
  owner => root,
  group => root,
  mode => 0644
}
# ...


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/-/Z6s-TnS-UDMJ.
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: Installing zip files

2012-10-29 Thread jcbollinger


On Monday, October 29, 2012 3:37:45 AM UTC-5, Luca Gioppo wrote:
>
> I have the problem of installing stuff in zip files (that is the tipical 
> way of distributing java stuffs as JBoss, WSO2).
> Which can be the preferred solution to make such an install:
> - the only option I see is gettin the zip with curl or wget and than 
> executing a unzip placing the stuff in the desired folder.
>
> Doing this leaves behind the zip files somewhere and removing it causes 
> puppet to download it again everytime.
>
> It would be best to have a sort of provider dedicated to zip so that it 
> can remove and can have all the knowledge of wheather the stuff is 
> installed or not.
>


ZIP is an archive file format, but what you are asking for requires a 
package management system.  It is impossible to write a general-purpose 
provider that can do what you suggest with ZIP.  You could write specific 
classes for managing the software contained in each such zip, leveraging 
your knowledge of the zip contents, but that's going to get extremely 
tricky if you need to ensure specific versions of such software.

 

>
> Logically I do not want the file in the server, but I need it to make 
> puppet do the work: if I understand well the puppet philosophy this way of 
> doing is a bit against it since I do not have to create a list of 
> instructions to obtain a result, but I should just list a set of 
> configutations (I need a file there because I need it)
>
> Any hint on good practices.
>


Even before considering Puppet, it is an excellent idea to insist on 
installing software on your computers only via their native package 
management system.  For RedHat-family Linuxes, for instance, that means 
using RPMs, and for Windows it means MSI.  That way, the system knows what 
software has been installed, and in some cases (e.g. RPM-based systems) it 
even knows exactly which files belong to which packages.  There are a lot 
of reasons why this is a good thing, but the most relevant one to your 
question is that Puppet can learn from the system whether a particular 
target package is already installed.

If the software you want to install is not already available packaged for 
the appropriate package-management system, then you may need to build your 
own packages and keep them in your own local repository.  How hard that 
would be depends on the software to be packaged and the target packaging 
system, but if the software is already available as a ZIPped image then it 
probably isn't to hard to just convert the ZIP to a bona fide package.


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/-/k1ze6R8CHBYJ.
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: RHEL 6 Protected multilib versions Requirment to have both 32 and 64 bit libs installed.

2012-10-29 Thread jcbollinger


On Monday, October 29, 2012 4:46:56 AM UTC-5, Jelle B. wrote:
>
> Hi I have seen numerous posts via Google saying this is an issue but not 
> found a puppet based solution for it.
>
> Does anyone have an idea how I can make this work ? I do realize I am 
> looking at separate versions and was playing with the idea to force a more 
> locked down versioning to keep them the same but no idea if I can even do 
> this.
>
> below the error :
>
> (/Stage[main]/Libstdc/Package[libstdc++.i686]/ensure) change from absent 
> to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install 
> libstdc++.i686' returned 1: Error: Protected multilib versions: 
> libstdc++-4.4.6-4.el6.i686 != libstdc++-4.4.6-3.el6.x86_64#012 You could 
> try using --skip-broken to work around the problem#012 You could try 
> running: rpm -Va --nofiles --nodigest
>
> the .pp :
>
> class libstdc {
>
> Class["rhn"]->Class["libstdc"]
>
> package { "libstdc++.i686":
> ensure => installed,
> }
>
> package { "libstdc++":
> ensure => installed,
> }
>
> }
>
>

A setup like that is bound to cause you trouble in Puppet, because Puppet's 
yum and rpm Package providers don't recognize the architecture as part of 
the resource title.  Because Puppet will pass it through to yum, you can, 
in some circumstances, get it to install the package that way, but Puppet 
will try to do so again on every run because it will not recognize the 
package as already installed.

In your particular case, you also have trouble because Puppet manages each 
package via a separate yum / rpm / whatever command.  If you were manually 
doing what you want Puppet to do for you, you would probably name both 
packages in one yum command, and it would work.

If you always want the multilib behavior you're asking about, then your 
best bet (for several reasons) would be to update your yum configuration to 
say so.  The setting you are looking for is 'multilib_policy' in the [main] 
section of /etc/yum.conf.  Set it to "all" (default is "best" in recent 
RHEL / CentOS / etc.).  Having done that, just manage packages by name 
without worrying about architecture.  You can and probably should manage 
that file via Puppet if you're going to use it to get the behavior you 
want; in that case you should set up relationships between your Packages 
and that File to ensure that the file is managed first.

On the other hand, you really shouldn't need to worry about this sort of 
question if you are making good use of your package management system.  Yum 
will install appropriate packages for your architecture, and when it does 
so it will install the packages for any needed libraries, accounting for 
architecture.  Only if you throw pre-built but unpackaged software into the 
mix do you need to pay attention to installing specific-architecture 
packages.  So don't do that if you can possibly avoid it.

If necessary, you can often wrap a third-party, binary-only software 
distributions into RPMs.  Doing so is actually much easier than the 
standard approach of building the software from source via the RPM system, 
and it gets you a package that is easy to install and remove, and that 
declares its dependencies in a way that yum and the RPM system can read and 
evaluate (the RPM build system automatically scans the files to install for 
library dependencies).


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/-/LfSG5T15AcUJ.
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] Have Class Only Perform Actions When There Is Work To Do (i.e. Making Them Idempotent)

2012-10-29 Thread joe dhonny
Hi Dave,

Am 26.10.2012 20:50, schrieb Dave Mankoff:
> Interesting. It sounds like you're actually advocating _for_ the bash 
> script approach. I wanted to avoid package management systems only because 
> they are way more complicated than a basic install of python requires:
> 
>   wget python.tgz
>   tar -xzvf python.tgz
>   cd python
>   ./configure --prefix=/install/path
>   make
>   make test
>   make install
> 
> I wanted to make (I have made?) a simple "python" class that accepts a 
> python version number, downloads it, and runs those steps, irrespective of 
> the base Linux flavor. 

Fetch a copy of the Puppet 2.7 Cookbook and read pages 130 and 131,
there's a recipe that does exactly what you want.

> I don't know much of anything about deb or rpm files 
> other than that they are more complicated than that; and I don't want to 
> have to package up and maintain several different python versions for 
> several different package managers. 

For deb files it's pretty easy: install "checkinstall" on your desktop,
type "checkinstall make install" instead of "make install" and your
package is ready to go.

The "alien" package comes in handy to from time to time, as it converts
.tgz to .deb or .rpm

hth

-- 
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: defined types and enc

2012-10-29 Thread jcbollinger


On Friday, October 26, 2012 3:53:42 PM UTC-5, erkules wrote:
>
>
> On Fri, Oct 26, 2012 at 12:24:52PM -0700, jcbollinger wrote: 
> > 
> [snip] 
> >   
> > 
> > > If not is there a trick to call a class many times for a node. (Maybe 
> by 
> > > manipulating the name?) 
> > > 
> > > 
> > You can create classes with different names but similar content, or you 
> can 
> > use one class that wraps all the resources you want.  For example, 
> > 
> > class mymodule::lxc_application_containers { 
> >   mymodule::lxc_application_container { 'container1: 
> > application => 'Awesomeness1.1' 
> > # other parameters 
> >   } 
> >   mymodule::lxc_application_container { 'container2: 
> > application => 'Moneymaker3.2' 
> > # other parameters 
> >   } 
> >   # other containers ... 
> > } 
>
> Ok my defined types in a class. 
> How would that look like in a yaml-output? 
>


It would just look like the class.  The declarations inside a class are not 
represented in the ENC output that declares the class.  I presented a model 
of how the class itself might look in my previous message.
 

>
> > 
> > Supposing that the point is to select a subset of the available 
> > applications for each target node, using the one-class approach, you can 
> do 
> > that via global variables (yuck), class parameters (meh), or data from 
> an 
> > external source (best bet). 
>
> Hmm, right now it is the same application running multiple times. 
>
>
It makes little difference, really, whether it is multiple instances of one 
application or of different ones.  That the applications are all the same 
does favor modeling that application itself via a definition instead of a 
class, however.
 

>
> > 
> > On the other hand, don't discard the idea of different classes too 
> > lightly.  In many cases it makes a lot of sense.  In particular, it may 
> > relieve pressure on your defined type to be sufficiently flexible to do 
> > everything needed for any application you might ever want to use. 
>  Having a 
> > separate class for each module could make it a lot easier to deal with 
> the 
> > special needs of each application. 
> > 
>
> Right, in my case it is (for now) the same application. Having for every 
> application 
> a different name would no be that dynamic I would suggest/hope it to be. 
> As the differ in IP and some dirs only. 
> So this would suggest to write a class for every application I want to run 
> then? 
>
>
You'll have to judge for yourself what makes the most sense for your site.  
What I'm saying is that if you find yourself writing a lot of conditionals 
and special cases to support various different applications, then that 
suggests you might be better off creating separate classes for those 
applications.  Such classes might or might not leverage whatever 
general-purpose application resources you create, however works best for 
you.

As for being dynamic, as long as you do not rely on parametrized-style 
declarations -- either because your classes are not parametrized, or 
because you rely on hiera (in Puppet 3) to provide any needed parameter 
customization -- you can have entirely as much dynamic behavior in your 
manifests with classes as with definitions.  On the other hand, I think 
that's rather a straw man in the context of an ENC.  The whole point of an 
ENC is to provide whatever dynamic behavior you want, therefore you don't 
need a lot of dynamism in the manifests of an ENC-driven site.


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/-/JrzSVa633C8J.
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] array and string

2012-10-29 Thread Erik Dalén
or use the join() function from puppetlabs-stdlib module.


--  
Erik Dalén


On Monday 29 October 2012 at 05:08, Johan De Wit wrote:

> Hi,
>  
> you can use inline_template, this way you can incorperate ruby code in  
> your manifest
>  
> $server_string = inline_template("<% server.join(' ') %>")
>  
> see  
> http://docs.puppetlabs.com/references/latest/function.html#inlinetemplate
>  
> hope this helps
>  
> Grts
>  
> Jo
>  
> On 10/29/2012 09:29 AM, Hiu wrote:
> > hi all,
> >  
> > I have an array and i would like to convert it into a string format.
> >  
> > e.g.
> >  
> > $server = ["node1", "node2", "node3"]
> >  
> > when I write my puppet codes
> >  
> > exec { "myscript -S $server":
> > path => 
> > }
> >  
> > my $server becomes a continual string like: "node1node2node3", instead  
> > of "node1 node2 node3". How can i have a delimiter of space in between  
> > the array item?
> >  
> > thanks!
> > --  
> > 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/-/OdJUlKWcv9wJ.
> > 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.
>  
>  
>  
>  
> --  
> Johan De Wit
>  
> Open Source Consultant
> Red Hat Certified Engineer (805008667232363)
> Puppet Certified Professional 2013 (PCP006)
> _
>  
> Open-Future Phone +32 (0)2/255 70 70
> Zavelstraat 72 Fax +32 (0)2/255 70 71
> 3071 KORTENBERG Mobile +32 (0)474/42 40 73
> BELGIUM http://www.open-future.be
> _
>  
> --  
> 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 
> (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.



[Puppet Users] Custom fact not loading in puppet...

2012-10-29 Thread Gavin Williams
Afternoon all,

I'm having issues with using a custom fact in Puppet. 

I've done some googling, and found lots of suggestions, but none of them 
solved my issue... 

I'm trying to use stdlib and facter_dot_d.rb to read in yaml files that I'm 
creating and convert them to facts. 
The facts work fine in facter, however they dont show up in puppet runs :( 

My facts file looks like this:

$ ls -l /etc/facter/facts.d/glassfish3.yaml
> -rw-r--r--. 1 root root 53 Oct 29 12:40 /etc/facter/facts.d/glassfish3.yaml
> $ cat /etc/facter/facts.d/glassfish3.yaml
> glassfish3_installed: true
> glassfish3_version: 3.1.2
>

Facter can see the fact:

$ sudo facter --puppet glassfish3_installed
> true
>

However a puppet run doesn't :(  

> $ sudo puppet agent -t
> Info: Retrieving plugin
> Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/iptables.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
> Info: Loading facts in /var/lib/puppet/lib/facter/etckepper_puppet.rb
> Info: Caching catalog for puppet-test.card.co.uk
> Info: Applying configuration version '1351514443'
> Setting up Glassfish3... Installed = . GF Version =  Operating system = 
> CentOS
> /Stage[main]/Act::Env::Glassfish3/Notify[glassfish3]/message: defined 
> 'message' as 'Setting up Glassfish3... Installed = . GF Version =  
> Operating system = CentOS'
> Creating Glassfish domain cms using portbase 9000.
>  Asadmin file is: /usr/local/glassfish-3.1.2/bin/asadmin.
> /Stage[main]/Glassfish::Domain/Notify[gfdomain]/message: defined 'message' 
> as 'Creating Glassfish domain cms using portbase 9000.
>  Asadmin file is: /usr/local/glassfish-3.1.2/bin/asadmin.'
> Environment = test
> /Stage[main]//Notify[environment]/message: defined 'message' as 
> 'Environment = test'
> Finished catalog run in 2.17 seconds
>

The code for the notify above is:

notify {'glassfish3':
>   message => "Setting up Glassfish3... Installed = 
> $::glassfish3_installed. GF Version = $glassfish3_version Operating system 
> = $::operatingsystem"}
>

Any ideas?

Cheers in advance. 

Gavin 

-- 
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/-/FsDpVglrMdIJ.
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: hiera broken in puppet-3

2012-10-29 Thread asq
W dniu piątek, 26 października 2012 18:19:22 UTC+2 użytkownik Ellison Marks 
napisał:
>
> I think that might have been renamed...
>
>
> http://docs.puppetlabs.com/puppet/3/reference/lang_variables.html#facts-and-built-in-variables
>
> Down near the bottom, under parser set variables, there's $module_name and 
> $caller_module_name. That what you meant to use?
>

it seems it's also broken: http://pastebin.com/irVAq407
i intend to model my hierarchy based on calling class (ie. put mysql 
specific things in mysql.yaml) .

-- 
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/-/qCIrrBQeTeMJ.
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] RHEL 6 Protected multilib versions Requirment to have both 32 and 64 bit libs installed.

2012-10-29 Thread Jelle B.
Hi I have seen numerous posts via Google saying this is an issue but not 
found a puppet based solution for it.

Does anyone have an idea how I can make this work ? I do realize I am 
looking at separate versions and was playing with the idea to force a more 
locked down versioning to keep them the same but no idea if I can even do 
this.

below the error :

(/Stage[main]/Libstdc/Package[libstdc++.i686]/ensure) change from absent to 
present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install 
libstdc++.i686' returned 1: Error: Protected multilib versions: 
libstdc++-4.4.6-4.el6.i686 != libstdc++-4.4.6-3.el6.x86_64#012 You could 
try using --skip-broken to work around the problem#012 You could try 
running: rpm -Va --nofiles --nodigest

the .pp :

class libstdc {

Class["rhn"]->Class["libstdc"]

package { "libstdc++.i686":
ensure => installed,
}

package { "libstdc++":
ensure => installed,
}

}

-- 
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/-/LcoLU6kHPtoJ.
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: bootstrap aws instance - set server address in instance puppet.conf?

2012-10-29 Thread sajan Tharayil


On Tuesday, 3 July 2012 02:28:28 UTC+5:30, Leej wrote:
>
> *Hello, new user here. I'm trying to bootstrap an aws instance and need 
> to change the server setting in puppet.conf on the client/instance that is 
> created. Is there anyway to do this beyond modifying hosts post-hoc?*


You can create a new AMI with a post install script call. (The Post install 
script can be kept on a webserver) and you can do what ever you want in 
that script like setting proper /etc/hosts, setting proper hostname and 
reverse mapping, setting proper resolver.conf file etc.

>
>
> puppet node_aws bootstrap --image ami-e1e8d395 --keyname mykey --login 
> ubuntu --keyfile ~mykeyfile.pem --puppetagent-certname aws_server_test 
> --region=eu-west-1 --type t1.micro -g webserver  


> This provisions an instance but fails to register a cert request on the 
> puppetmaster with :
>
> notice: Puppet is now installed on: 
> blahblah.eu-west-1.compute.amazonaws.com
> notice: No classification method selected
> notice: Signing certificate ...
> err: Signing certificate ... Failed
> err: Signing certificate error: Could not render to pson: getaddrinfo: 
> Name or service not known
>
> Checking the instances puppet.conf shows that the server config variable 
> is set to "puppet" which I want to change to "myserver.somewhere.com". 
> Now I dont know if this behaviour is a bug, I would have thought that since 
> I'm running puppet from the master server, bootstrapping should be able to 
> update the server variable correctly or there should at least be a command 
> line option.
>

This can be done in many ways:

1. Create a puppet agent wrapper which runs puppet every x interval and 
syncs with the right puppet master (Agent should run like puppetd --test 
--server 
2. If you have a DNS service set the DNS to search for the domain (If you 
do ping puppet, it should do ping puppet.company .com). For this you will 
have to set your resolver.conf file to search company.com.
3. Have a /etc/hosts file entry to resolve puppet
 

>
> I know I can run a script at somepoint and modify my hosts files but I'm 
> trying to keep things automated and simple. What am I missing?
>
> I should also note, if I ssh into the created instance I can modify the 
> puppet.conf file with the correct server name and a certificate request is 
> issued which I can then sign.
>
> Any help.best practices greatly appreciated - lj.
>



Best practices :

1. Keep your puppet master and Puppet CA separate
2. Have a proper DNS setup
3. Make all resolving through Resolver.conf file
4. Have a proper post install script which does hostname setting, hostname 
reverse mapping in /etc/hosts file, setting resolver.conf file, installing 
puppet agent or whatever wrapper you may have on top of puppet agent
4. Remove puppet default agent  run from /etc/init.d and have a daemon tool 
service which run puppet manually like puppetd --test
5. Keep a proper hostname standard and ask puppetCA to sign only the 
hostnames allowed.

-- 
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/-/LFmdgE_loigJ.
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] array and string

2012-10-29 Thread Johan De Wit

Hi,

you can use inline_template, this way you can incorperate ruby code in 
your manifest


$server_string = inline_template("<% server.join(' ') %>")

see 
http://docs.puppetlabs.com/references/latest/function.html#inlinetemplate


hope this helps

Grts

Jo

On 10/29/2012 09:29 AM, Hiu wrote:

hi all,

I have an array and i would like to convert it into a string format.

e.g.

$server = ["node1", "node2", "node3"]

when I write my puppet codes

exec { "myscript -S $server":
path => 
}

my $server becomes a continual string like: "node1node2node3", instead 
of "node1 node2 node3". How can i have a delimiter of space in between 
the array item?


thanks!
--
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/-/OdJUlKWcv9wJ.

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.



--
Johan De Wit

Open Source Consultant
Red Hat Certified Engineer(805008667232363)
Puppet Certified Professional 2013 (PCP006)
_

Open-Future   Phone   +32 (0)2/255 70 70
Zavelstraat 72Fax +32 (0)2/255 70 71
3071 KORTENBERG   Mobile  +32 (0)474/42 40 73
BELGIUM   http://www.open-future.be
_

--
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] Installing zip files

2012-10-29 Thread Luca Gioppo
I have the problem of installing stuff in zip files (that is the tipical 
way of distributing java stuffs as JBoss, WSO2).
Which can be the preferred solution to make such an install:
- the only option I see is gettin the zip with curl or wget and than 
executing a unzip placing the stuff in the desired folder.

Doing this leaves behind the zip files somewhere and removing it causes 
puppet to download it again everytime.

It would be best to have a sort of provider dedicated to zip so that it can 
remove and can have all the knowledge of wheather the stuff is installed or 
not.

Logically I do not want the file in the server, but I need it to make 
puppet do the work: if I understand well the puppet philosophy this way of 
doing is a bit against it since I do not have to create a list of 
instructions to obtain a result, but I should just list a set of 
configutations (I need a file there because I need it)

Any hint on good practices.
Luca

-- 
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/-/4xKQwlWUEJEJ.
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] array and string

2012-10-29 Thread Hiu
hi all,

I have an array and i would like to convert it into a string format.

e.g.

$server = ["node1", "node2", "node3"]

when I write my puppet codes

exec { "myscript -S $server":
path => 
}

my $server becomes a continual string like: "node1node2node3", instead of 
"node1 node2 node3". How can i have a delimiter of space in between the 
array item?

thanks!

-- 
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/-/OdJUlKWcv9wJ.
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.