Re: [Puppet Users] Re-inventing the Wheel (again?)

2013-06-20 Thread David Schmitt

On 2013-06-20 22:20, Eric Aiken wrote:

Has anyone created a "repo" of puppet modules for a given linux distro.
In my case CentOS. Seems there should be (at this point)
/etc/puppet/modules/CentOSx, that includes all the necessary
modules/manifest etc. that only need to be tweaked for local settings or
deleted for lack of need. According to the documentation and books i'm
working through, i'll need to download and modify module by module 10's
to 100+ modules/manifests/.pp files for a basic CentOS server running a
java app. Not counting the effort necessary for best practices of
parametrize classes.

What am I missing here?


https://github.com/example42/puppet-modules-nextgen

This is a repo of a good chunk of default modules that fit into site.pp, 
enc and hiera styled management workflows.



Regards, David

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: File directive

2013-06-20 Thread Roman Alekseev
Is the module below correct?

class nginx {

if defined(Package['nginx']) {
file { "/tmp/puppet-nginx.sh":
ensure  => "present",
owner   => "root",
group   => "root",
mode=> 0755,
source  => 
"puppet://$puppetserver/modules/nginx/puppet-nginx.sh",
require => Package['nginx'],
}

}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Puppet and VMWare - A potentially stooopid question

2013-06-20 Thread Michael Dodwell
VMWare put out SDK's for a number of languages if you don't want to use
perl. Python being another *nix based one. The SDK's come with a number of
example scripts that you can cut and paste without much effort to form a
script that should do everything you might want. Or you can wrap them up
with something simple like bash to get the same results.

I personally don't like vmware templates as you then have to manage and
upgrade them on a semi-regular basis, might as well look after a kickstart
environment and be done with it. Deployment time can be a little longer but
as it's automated I don't think it really matters for my purposes. YMMV.


On Fri, Jun 21, 2013 at 12:05 PM, Dan White  wrote:

> That might work for me if I did not hate Perl.
>
> No offense to folks that like it, but I had a very nasty experience with
> it early in my computer-career that pushed me away from it.
>
> I will still check it out.  Thanks for the pointer.
>
> I am currently using Cobbler with Puppet.  I know this combo can create
> VM’s -- already did it -- but I have been gaining understanding how VMWare
> works from its own kind of “templates”, and I would like to see if I can
> handle them with Puppet.  I know Enterprise Puppet can do it, but I do not
> have access to a bottomless budget :(
>
> On Jun 20, 2013, at 8:53 PM, Michael Dodwell wrote:
>
> Take a look at the Viper toolkit from VMWare. You can then create a script
> with the examples given and then use puppet to run the scripts to do stuff
> that you want.
>
> http://www.vmware.com/support/developer/viperltoolkit/
>
> Personally I use a VMA server to create instances, Razor to kickstart and
> register them against a puppetmaster, then puppet master to configure and
> deploy..
>
> On the VMA server I've setup some php to allow users to kick off perl
> scripts that start the build process.
>
> If only PL would release a reasonably priced Enterprise (without support
> even!) edition
>
> On Friday, June 21, 2013 7:39:57 AM UTC+10, Ygor wrote:
>>
>> But I'd rather be certain of the answer than guess or try it and go down
>> in flames:
>>
>> The question:  Can one integrate VMWare with Open Source Puppet ?  Or is
>> this a Puppet-Enterprise-only thing ?
>>
>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/kiPo7zf2lo0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Puppet and VMWare - A potentially stooopid question

2013-06-20 Thread Dan White
That might work for me if I did not hate Perl.

No offense to folks that like it, but I had a very nasty experience with it 
early in my computer-career that pushed me away from it.

I will still check it out.  Thanks for the pointer.

I am currently using Cobbler with Puppet.  I know this combo can create VM’s -- 
already did it -- but I have been gaining understanding how VMWare works from 
its own kind of “templates”, and I would like to see if I can handle them with 
Puppet.  I know Enterprise Puppet can do it, but I do not have access to a 
bottomless budget :(

On Jun 20, 2013, at 8:53 PM, Michael Dodwell wrote:

> Take a look at the Viper toolkit from VMWare. You can then create a script 
> with the examples given and then use puppet to run the scripts to do stuff 
> that you want.
> 
> http://www.vmware.com/support/developer/viperltoolkit/
> 
> Personally I use a VMA server to create instances, Razor to kickstart and 
> register them against a puppetmaster, then puppet master to configure and 
> deploy..
> 
> On the VMA server I've setup some php to allow users to kick off perl scripts 
> that start the build process.
> 
> If only PL would release a reasonably priced Enterprise (without support 
> even!) edition 
> 
> On Friday, June 21, 2013 7:39:57 AM UTC+10, Ygor wrote:
> But I'd rather be certain of the answer than guess or try it and go down in 
> flames:
> 
> The question:  Can one integrate VMWare with Open Source Puppet ?  Or is this 
> a Puppet-Enterprise-only thing ?
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Puppet and VMWare - A potentially stooopid question

2013-06-20 Thread Dan White
I know I can manage Linux VM’s with Puppet, I guess I am looking to get Puppet 
provision them as well.

I believe I will explore the possibilities in The Forge and also whip up a demo 
PE-Master to compare.
The demo PE-Master might impress the customer sufficiently to sell the idea of 
going that way.

Wish me luck !!

On Jun 20, 2013, at 7:47 PM, Justin Stoller wrote:
> On Thu, Jun 20, 2013 at 2:39 PM, Dan White  wrote:
> But I'd rather be certain of the answer than guess or try it and go down in 
> flames:
> 
> The question:  Can one integrate VMWare with Open Source Puppet ?  Or is this 
> a Puppet-Enterprise-only thing ?
> 
> You can integrate anything you'd like with OSS :) We have a PL supported 
> Enterprise-only extension to Cloud Provisioner to integrate with VMWare, but 
> it uses the open Face API[1]. There's also a number of open source modules to 
> stand up and manage VMWare products on the Forge and Github.[2] How do you 
> want to integrate Puppet w/ VMWare?
> 
>  - Justin
> 
> 1. http://docs.puppetlabs.com/pe/latest/cloudprovisioner_vmware.html
> 2. https://forge.puppetlabs.com/modules?utf-8=%E2%9C%93&q=vmware
> 
> “Sometimes I think the surest sign that intelligent life exists elsewhere in 
> the universe is that none of it has tried to contact us.”
> Bill Waterson (Calvin & Hobbes)

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: Control directory mode only on creation?

2013-06-20 Thread Michael Dodwell
exec {
  command => "mkdir /somedir; chown newuser /somedir",
  unless => "test -d /somedir"
}


On Friday, June 21, 2013 8:24:59 AM UTC+10, Robin Powell wrote:
>
>
> Is there a way to make a directory and set its owner and mode and so 
> on only if it didn't exist? 
>
> That is: I don't want to *reset* the owner and mode if it's already 
> there. 
>
> -Robin 
>
> -- 
> http://intelligence.org/ :  Our last, best hope for a fantastic future. 
> .i ko na cpedu lo nu stidi vau loi jbopre .i danfu lu na go'i li'u .e 
> lu go'i li'u .i ji'a go'i lu na'e go'i li'u .e lu go'i na'i li'u .e 
> lu no'e go'i li'u .e lu to'e go'i li'u .e lu lo mamta be do cu sofybakni 
> li'u 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: Puppet and VMWare - A potentially stooopid question

2013-06-20 Thread Michael Dodwell
Take a look at the Viper toolkit from VMWare. You can then create a script 
with the examples given and then use puppet to run the scripts to do stuff 
that you want.

http://www.vmware.com/support/developer/viperltoolkit/

Personally I use a VMA server to create instances, Razor to kickstart and 
register them against a puppetmaster, then puppet master to configure and 
deploy..

On the VMA server I've setup some php to allow users to kick off perl 
scripts that start the build process.

If only PL would release a reasonably priced Enterprise (without support 
even!) edition 



On Friday, June 21, 2013 7:39:57 AM UTC+10, Ygor wrote:
>
> But I'd rather be certain of the answer than guess or try it and go down 
> in flames:
>
> The question:  Can one integrate VMWare with Open Source Puppet ?  Or is 
> this a Puppet-Enterprise-only thing ?
>
> “Sometimes I think the surest sign that intelligent life exists elsewhere 
> in the universe is that none of it has tried to contact us.”
> Bill Waterson (Calvin & Hobbes)
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Set environment variable that is visible to package installation

2013-06-20 Thread Michael Dodwell
Another method is to use exec {} instead of package {} to install the rpm. 
This will enable you to set environment => 'BATCH=myval', path => ['/bin', 
'/usr/bin'] etc

use unless to check if the package is installed so it doesn't try to 
install it multiple times.

On Friday, June 21, 2013 12:53:38 AM UTC+10, nikolavp wrote:
>
> You can get the environment variable from puppet.conf or if it is 
> another variable, you can use facter. As long as you are controlling 
> your packages you can check those after that. 
>
> -- 
> Nikola 
>
> On Wed, Jun 19, 2013 at 10:08:46AM -0700, Kevin Lange wrote: 
> > We have RPMs which requires an environment variable to be set prior to 
> > installation (contains conf information).  What is the best way to do 
> > this?  I'd like to avoid setting this environment var in each systems' 
> > profile.  It would be nice to have an option to do this within the 
> package 
> > type, but I think that's not very likely. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Puppet Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to puppet-users...@googlegroups.com . 
> > To post to this group, send email to 
> > puppet...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/puppet-users. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Puppet and VMWare - A potentially stooopid question

2013-06-20 Thread Justin Stoller
On Thu, Jun 20, 2013 at 2:39 PM, Dan White  wrote:

> But I'd rather be certain of the answer than guess or try it and go down
> in flames:
>
> The question:  Can one integrate VMWare with Open Source Puppet ?  Or is
> this a Puppet-Enterprise-only thing ?
>

You can integrate anything you'd like with OSS :) We have a PL supported
Enterprise-only extension to Cloud Provisioner to integrate with VMWare,
but it uses the open Face API[1]. There's also a number of open source
modules to stand up and manage VMWare products on the Forge and Github.[2]
How do you want to integrate Puppet w/ VMWare?


 - Justin

1. http://docs.puppetlabs.com/pe/latest/cloudprovisioner_vmware.html
2. https://forge.puppetlabs.com/modules?utf-8=%E2%9C%93&q=vmware

>
> “Sometimes I think the surest sign that intelligent life exists elsewhere
> in the universe is that none of it has tried to contact us.”
> Bill Waterson (Calvin & Hobbes)
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Join us at PuppetConf 2013, August 22-23 in San Francisco -
http://bit.ly/pupconf13

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: How to make a package dependant on a class for the repository.

2013-06-20 Thread joe
Does your repos class have a bunch of classes included? If so, those are 
not caught by the require and you need to use the anchor pattern:

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

The ordering (no matter how you do it) only orders the *resources* in that 
class. Not the resources in classes that are *included* in your repos class.

On Wednesday, June 19, 2013 6:00:03 PM UTC-6, Stack Kororā wrote:
>
> Greetings!
>
> tl;dr Why doesn't require=>Class work?
>
> I have a module I built that I creatively called "repos". This does a 
> number of things for me:
> * I have many systems on different networks. Depending on the network 
> depends on which repository the servers get their packages from.
> * I have many OS's (RHEL, Scientific, CentOS, SuSE) and several different 
> releases of those OS's (ex: RHEL6 vs RHEL5).
> * Some systems get repositories that others don't (ex: VMware guests get 
> the ESXi guest tools repo).
> * We roll our own packages for some software; only systems of a certain 
> type get these repos.
> * ect.
>
> This class does a wonderful job for me. I barely have to do anything in 
> the node definition other than "class { 'repos': } " and it just figures 
> out which systems get what repo's based on facter and various parameters 
> (like current network IP). 
>
> Here is the problem though.
> package {["htop":ensure=>installed, }
>
> Chances are *really* good that on first runs when the repo hasn't yet been 
> created, what will happen is:
> * Error: can't find htop.
> * Installing EPEL
> *Done!
>
> Well that isn't what I want, obviously. Thus I tried:
> package {["htop":ensure=>installed,require=>Class['repos'],}
>
> Still the same result as before. It never fully configures the repo before 
> trying to install. Then I tried:
> package {["htop":ensure=>installed,require=>Yumrepo['EPEL'],}
>
> It works!! Hooray! And then I hit a failure point. This next statement 
> works for Scientific Linux but fails for CentOS6 because a CentOS system 
> won't have the SL6 repo!
> package {["tuned":ensure=>installed,require=>Yumrepo['SL6'],}
>
> I have come up with two "solutions".
> 1) Change all the repos to use generic names like "Base" and "Security". 
> While it is a big bandaid, it doesn't really fix the problem as there is 
> still potential for packages to conflict.
>
> 2) Find out why "require=>Class['repos']" doesn't work and fix it. This 
> would solve all my problems if the repos were run and configured properly 
> before packages were installed. The only "problem" would then be to make 
> sure I am not trying to install a package that legitimately doesn't exist 
> in the repos (like tuned on a CentOS 5 box) but that would fall squarely 
> into a PEBKAC and there is only so much I can script to catch those. :-)
>
> Can anyone help me with this please? Any ideas on how I can fix this?
>
> Thanks!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] puppet node deactivate

2013-06-20 Thread David Kerr
Hello,

I'm in the process of upgrading my puppet from 2x to 3.2.1.

During my testing i found that it appears that puppet node deactivate isn't 
removing nodes from storeconfigs.

Specifically:
On my puppet server:

> puppet node deactivate hub15.mydomain.com
Submitted 'deactivate node' for hub15.mydomain.com with UUID 
3f698c7a-dd1e-49a4-8fdd-941e5bc01970

followed by:
On my haproxy:
> puppet agent --test --noop
 backend b1
  balance  roundrobin
@@ -72,15 +65,16 @@
   option  httpclose
   option  forwardfor
   server  hub01 192.168.0.218:80  check
-  server  hub02 192.168.4.181:80  check
   server  hub03 192.168.0.19:80  check
   server  hub04 192.168.4.62:80  check
-  server  hub10 192.168.0.48:80  check
-  server  hub15 192.168.0.110:80  check
+  server  hub05 192.168.0.151:80  check
+  server  hub12 192.168.0.33:80  check
+  server  hub14 192.168.4.27:80  check
+  server  hub15 192.168.0.163:80  check

I usually do puppet node clean/puppet node deactivate.

Any ideas?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Apply a specific manifest on agent

2013-06-20 Thread Denmat
Hi, depending on your code you can look at a few options.

When an agent connects to the puppet master you can supply a --tag var that you 
can then inspect and make changes in your code paths.

The other thing you can do is add --environment and use the environment 
features that puppet has to load a completely different site.pp. 

There's a puppet git workflows page that will come up in google that explains 
the environments - tags can be found in puppet docs. (Can't get you direct 
links, sorry).

THT
Den

On 21/06/2013, at 7:21, Dhananjayan Ramesh  wrote:

> Hi All,
> 
> I am new to Puppet and I am wondering if there is a way to just apply a 
> manifest one-time (present on the master, not included in site.pp) on an 
> agent node without having to edit site.pp? It's like I want to run a command 
> on the agent that will do this for me.
> 
> Something analogous to "puppet apply " except that the manifest is 
> not locally present on the agent, but on the master...
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Control directory mode only on creation?

2013-06-20 Thread Robin Lee Powell

Is there a way to make a directory and set its owner and mode and so
on only if it didn't exist?

That is: I don't want to *reset* the owner and mode if it's already
there.

-Robin

-- 
http://intelligence.org/ :  Our last, best hope for a fantastic future.
.i ko na cpedu lo nu stidi vau loi jbopre .i danfu lu na go'i li'u .e
lu go'i li'u .i ji'a go'i lu na'e go'i li'u .e lu go'i na'i li'u .e
lu no'e go'i li'u .e lu to'e go'i li'u .e lu lo mamta be do cu sofybakni li'u

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Can't find source of "Removing mount" errors

2013-06-20 Thread Brandon
I've searched, but haven't found anything.  I will continue looking.

On Thursday, June 13, 2013 6:25:35 AM UTC-7, jcbollinger wrote:
>
>
>
> On Thursday, June 13, 2013 1:34:32 AM UTC-5, denmat wrote:
>>
>> Hi, 
>>
>> You sure that a grep for 'mount' through your manifest finds nothing? 
>>
>>
> Yes, that's what I was about to recommend.  And it is necessary to check 
> all manifest locations -- the 'manifests' subdirectory of every directory 
> in the module path (recursively), the entry-point manifest (normally 
> site.pp), and every manifest 'import'ed by any of those manifests 
> (recursively).
>
> It is not sufficient to search for the mount-point directory names, 
> because these do not necessarily exist as complete strings anywhere in the 
> manifests.  They may instead be assembled at need from two or more parts, 
> one or both of which may be variables.  Some variables involved could even 
> be provided by Puppet rather than declared in any manifest.
>
> I can think of at least one way to obfuscate manifests so that the 'mount' 
> resource type name would not appear either, but I cannot imagine that 
> happening accidentally, and I'm not up for helping overcome intentional 
> manifest obfuscation.
>
>
> John
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Puppet and VMWare - A potentially stooopid question

2013-06-20 Thread Dan White
But I'd rather be certain of the answer than guess or try it and go down in 
flames: 

The question: Can one integrate VMWare with Open Source Puppet ? Or is this a 
Puppet-Enterprise-only thing ? 


“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.” 
Bill Waterson (Calvin & Hobbes) 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Apply a specific manifest on agent

2013-06-20 Thread Dhananjayan Ramesh
Hi All,

I am new to Puppet and I am wondering if there is a way to just apply a 
manifest one-time (present on the master, not included in site.pp) on an 
agent node without having to edit site.pp? It's like I want to run a 
command on the agent that will do this for me.

Something analogous to "puppet apply " except that the manifest 
is not locally present on the agent, but on the master...

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Upgrade from 2.7.20 to 2.7.22 breaks puppet-dashboard

2013-06-20 Thread Joe Benson
I upgraded our puppetmaster from 2.7.20 to 2.7.22 and puppet dashboard quit
importing reports.  I'm getting a failed task with this error message.


undefined method `>=' for nil:NilClass
Backtrace 
 /usr/share/puppet-dashboard/lib/report_transformer.rb:18:in `apply'
/usr/share/puppet-dashboard/lib/report_transformer.rb:8:in
`apply'  /usr/share/puppet-dashboard/lib/report_transformer.rb:18:in
`inject'  /usr/share/puppet-dashboard/lib/report_transformer.rb:7:in
`each'  /usr/share/puppet-dashboard/lib/report_transformer.rb:7:in
`inject'  /usr/share/puppet-dashboard/lib/report_transformer.rb:7:in
`apply'  /usr/share/puppet-dashboard/app/models/report.rb:112:in
`create_from_yaml'  /usr/share/puppet-dashboard/app/models/report.rb:90:in
`create_from_yaml_file'

Installed RPMS from yum.puppetlabs.com

rpm -qa |grep puppet

puppet-server-2.7.22-1.el5
puppet-2.7.22-1.el5
puppet-dashboard-1.2.23-1.el5

If I back-rev puppet and puppet-server to 2.7.20 it works.

Any Ideas?

Thanks,

Joe

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Re-inventing the Wheel (again?)

2013-06-20 Thread Ashley Penney
On Thu, Jun 20, 2013 at 4:20 PM, Eric Aiken  wrote:

> I'm new to puppet and working my way through the documentation.  I'm
> struggling with the puppet labs module repo.
>
> I've toyed with numerous automation and configuration methodologies over
> the decades. Perhaps I'm seeing puppet wrong,   Compared with CFEngine
> there is a a lot I like, but I'm not sure why I'm still having to re-invent
> the wheel for a linux server distribution.  What I mean is, why at this
> point in the linux lifecycle, there are not standard modules for the 10,50
> or 100 things that an admin must change to deploy a linux server in prod or
> dev
>
> Even though puppetlabs has a modules repo, if you look for some basic
> modules:  sudoer,  resolv.conf, ifcfg, there a numerous "instances"
> of modules by users.  Each with their own idiosyncrasies.  Why do admins
> have to keep re-inventing the wheel for each iteration of Config Mgmt and
> Monitoring tools.
>
> Has anyone created a "repo" of puppet modules for a given linux distro.
> In my case CentOS.  Seems there should be (at this point)
> /etc/puppet/modules/CentOSx, that includes all the necessary
> modules/manifest etc.  that only need to be tweaked for local settings or
> deleted for lack of need.  According to the documentation and books i'm
> working through, i'll need to download and modify module by module 10's to
> 100+ modules/manifests/.pp files for a basic CentOS  server running a java
> app.  Not counting the effort necessary for best practices of parametrize
> classes.
>
> What am I missing here?
>
>
I've had a number of jobs now that all used Linux and all did "sort of the
same things" and yet in almost every case the configuration of the systems
ended up radically different.  In some cases this was due to security
requirements, or legacy issues, or personal tastes amongst the people
involved in how to "best" setup things.  In some cases we just used init
scripts, in others we wanted to integrate monit to restart services
automatically, in some we needed to do weird pam stuff to log console
keystrokes.

What I'm driving at here is that there's just so many different things you
can do with things as simple as sudoers that everyone reinvents the wheel
for their specific circumstance.  The trouble with generic modules that are
flexible enough to handle all use cases is that they become complex!  I've
written a sudoers module that relied heavily on "augeas" to parse and do
all kinds of sudoers stuff to enable really complex sudoer magic.  At the
very next job we pushed out a single sudoers file to all servers.

In a situation like that do you really want all the complexity of a module
that includes functions, maybe providers, defines, all kinds of stuff that
is difficult to maintain yourself when you can write a couple of quick
classes that do exactly what you want? :)

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Templates modified on puppetmaster but clients not seeing changes

2013-06-20 Thread Phil Gardner
I fail for confusing underscores and hyphens. Thanks for helping point
that out. The issue was that I was pointing to the wrong module.

As for the notify/exec portion, it actually runs fine with just having
it notify the exec when the file changes. It seems to work with the way
it is, without having subscribe in the exec resource.

Carry on, nothing to see here except some typos...



On 06/20/2013 04:09 PM, Dan White wrote:
> Trying again, less typos:
> 
> http://docs.puppetlabs.com/references/latest/type.html#exec
> scroll down to the "refreshonly" parameter and compare it to your code.
> 
> “Sometimes I think the surest sign that intelligent life exists elsewhere in 
> the universe is that none of it has tried to contact us.”
> Bill Waterson (Calvin & Hobbes)
> 
> - Original Message -
> From: "Phil Gardner" 
> To: puppet-users@googlegroups.com
> Sent: Thursday, June 20, 2013 1:22:44 PM
> Subject: Re: [Puppet Users] Templates modified on puppetmaster but clients 
> not seeing changes
> 
> nodes.pp:
> 
> node /^testserver-.*/ {
>   $centos_version = '6.4'
>   $updates_enabled = '1'
>   include yum
> }
> 
> --
> 
> modules/yum/manifests/init.pp:
> 
> class yum {
>   file { 'CentOS-Base.repo':
> mode=> '0644',
> owner   => 'root',
> group   => 'root',
> path=> '/etc/yum.repos.d/CentOS-Base.repo',
> content => template('yum/CentOS-Base.repo.erb'),
> notify  => Exec['clean'],
>   }
>   exec { 'clean':
> command => 'yum clean all',
> path=> '/usr/bin/',
> --> subscribe   => File["/etc/yum.repos.d/CentOS-Base.repo"],   <--- You need 
> to tell it what file to watch !
> refreshonly => true,
>   }
> }
> 
> --
> 
> modules/yum/templates/CentOS-Base.repo.erb:
> 
> [base]
> name=CentOS-$releasever - Base
> #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
> #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
> baseurl=http://yumrepo.<%= @datacenter %>.example.net/repos/centos/<%=
> centos_version %>/os/$basearch/
> gpgcheck=1
> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
> 
> #released updates
> [updates]
> name=CentOS-$releasever - Updates
> #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
> #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
> baseurl=http://yumrepo2.<%= @datacenter %>.example.net/repos/centos/<%=
> centos_version %>/updates/$basearch/
> enabled=<%= updates_enabled -%>
> gpgcheck=1
> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
> 

-- 
_
Phil Gardner
PGP Key ID 0xFECC890C
OTR Fingerprint 6707E9B8 BD6062D3 5010FE8B 36D614E3 D2F80538


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re-inventing the Wheel (again?)

2013-06-20 Thread Eric Aiken
I'm new to puppet and working my way through the documentation.  I'm 
struggling with the puppet labs module repo.

I've toyed with numerous automation and configuration methodologies over 
the decades. Perhaps I'm seeing puppet wrong,   Compared with CFEngine 
there is a a lot I like, but I'm not sure why I'm still having to re-invent 
the wheel for a linux server distribution.  What I mean is, why at this 
point in the linux lifecycle, there are not standard modules for the 10,50 
or 100 things that an admin must change to deploy a linux server in prod or 
dev  

Even though puppetlabs has a modules repo, if you look for some basic 
modules:  sudoer,  resolv.conf, ifcfg, there a numerous "instances" 
of modules by users.  Each with their own idiosyncrasies.  Why do admins 
have to keep re-inventing the wheel for each iteration of Config Mgmt and 
Monitoring tools.

Has anyone created a "repo" of puppet modules for a given linux distro.  In 
my case CentOS.  Seems there should be (at this point) 
/etc/puppet/modules/CentOSx, that includes all the necessary 
modules/manifest etc.  that only need to be tweaked for local settings or 
deleted for lack of need.  According to the documentation and books i'm 
working through, i'll need to download and modify module by module 10's to 
100+ modules/manifests/.pp files for a basic CentOS  server running a java 
app.  Not counting the effort necessary for best practices of parametrize 
classes.

What am I missing here?


Thanks in advance.


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: How to apply puppet manifests toa remote host?

2013-06-20 Thread Charlie Brune
I'm wondering if I have the same question.

I have a laptop that works well with my Puppet Master while I'm at home.  
However, when I leave home, puppet no longer is able to apply the manifests 
(configs) assigned to it.

I was hoping that it would simply continue to apply whatever manifests it 
knew about while at home before I left.

Should I not be using the Master/Agent technique for using Puppet?

Thanks,
Charlie

On Thursday, June 13, 2013 5:29:31 AM UTC-5, Sirisha wrote:
>
> Hi All,
>
> Am new to puppet and started writing simple  manifest files.
>
> I have setup Server/Client mode for puppet and when I try to apply my 
> manifest to local machine using "puppet agent" everything works well.
>
> Is there any option to apply the manifests to a remote machine without ssh 
> into the machine?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Templates modified on puppetmaster but clients not seeing changes

2013-06-20 Thread Dan White
Trying again, less typos:

http://docs.puppetlabs.com/references/latest/type.html#exec
scroll down to the "refreshonly" parameter and compare it to your code.

“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

- Original Message -
From: "Phil Gardner" 
To: puppet-users@googlegroups.com
Sent: Thursday, June 20, 2013 1:22:44 PM
Subject: Re: [Puppet Users] Templates modified on puppetmaster but clients not 
seeing changes

nodes.pp:

node /^testserver-.*/ {
  $centos_version = '6.4'
  $updates_enabled = '1'
  include yum
}

--

modules/yum/manifests/init.pp:

class yum {
  file { 'CentOS-Base.repo':
mode=> '0644',
owner   => 'root',
group   => 'root',
path=> '/etc/yum.repos.d/CentOS-Base.repo',
content => template('yum/CentOS-Base.repo.erb'),
notify  => Exec['clean'],
  }
  exec { 'clean':
command => 'yum clean all',
path=> '/usr/bin/',
--> subscribe   => File["/etc/yum.repos.d/CentOS-Base.repo"],   <--- You need 
to tell it what file to watch !
refreshonly => true,
  }
}

--

modules/yum/templates/CentOS-Base.repo.erb:

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://yumrepo.<%= @datacenter %>.example.net/repos/centos/<%=
centos_version %>/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://yumrepo2.<%= @datacenter %>.example.net/repos/centos/<%=
centos_version %>/updates/$basearch/
enabled=<%= updates_enabled -%>
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Templates modified on puppetmaster but clients not seeing changes

2013-06-20 Thread Dan White
The obvious first.

“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

- Original Message -
From: "Phil Gardner" 
To: puppet-users@googlegroups.com
Sent: Thursday, June 20, 2013 1:22:44 PM
Subject: Re: [Puppet Users] Templates modified on puppetmaster but clients not 
seeing changes

nodes.pp:

node /^testserver-.*/ {
  $centos_version = '6.4'
  $updates_enabled = '1'
  include yum_new  <--- this does not match the 
name of the module or class
}

--

modules/yum/manifests/init.pp:

class yum {
  file { 'CentOS-Base.repo':
mode=> '0644',
owner   => 'root',
group   => 'root',
path=> '/etc/yum.repos.d/CentOS-Base.repo',
content => template('yum-new/CentOS-Base.repo.erb'),< this does not 
match the name of the module
notify  => Exec['clean'],
  }
  exec { 'clean':
command => 'yum clean all',
path=> '/usr/bin/',
refreshonly => true,
  }
}

--

modules/yum/templates/CentOS-Base.repo.erb: < this does not match 
the path in the template parameter

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://yumrepo.<%= @datacenter %>.example.net/repos/centos/<%=
centos_version %>/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://yumrepo2.<%= @datacenter %>.example.net/repos/centos/<%=
centos_version %>/updates/$basearch/
enabled=<%= updates_enabled -%>
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

--

On 06/20/2013 12:50 PM, Dan White wrote:
> What's the manifest for the file resource, please ?
> Could be any number of things
> 
> “Sometimes I think the surest sign that intelligent life exists
> elsewhere in the universe is that none of it has tried to contact us.”
> Bill Waterson (Calvin & Hobbes)
> 
> 
> *From: *"Phil Gardner" 
> *To: *puppet-users@googlegroups.com
> *Sent: *Thursday, June 20, 2013 12:39:14 PM
> *Subject: *[Puppet Users] Templates modified on puppetmaster but clients
> not seeing changes
> 
> Has anyone experienced this before? The template works fine and creates
> the file no problem if the file doesn't exist, but it will not change
> the file if I modify the template.
> 
> My google-fu has come up short. Using 2.7.17.
> 
> 
> 
> -- 
> _
> Phil Gardner
> PGP Key ID 0xFECC890C
> OTR Fingerprint 6707E9B8 BD6062D3 5010FE8B 36D614E3 D2F80538
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
_
Phil Gardner
PGP Key ID 0xFECC890C
OTR Fingerprint 6707E9B8 BD6062D3 5010FE8B 36D614E3 D2F80538


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: 2.7 Dynamic scoping warnings - which way should I jump?

2013-06-20 Thread Nick Fagerlund
Hey Dirk,

Yeah, we need to re-write that page, sorry. 

Class parameters are absolutely the way to go -- they're easier to deal 
with in Puppet 3, and they DO work with include, as long as you back them 
up with Hiera. The key feature to learn about is automatic class parameter 
lookup: 
http://docs.puppetlabs.com/hiera/1/puppet.html#automatic-parameter-lookup 
There's a bit of action-at-a-distance to deal with, but it's super flexible 
and lets you do most of what you'd want to do. 

The other thing you should learn about is the two-level "roles and 
profiles" pattern -- Craig Dunn has a post that lines up with what our 
services people have been doing, and it works really well. 
http://www.craigdunn.org/2012/05/239/ This has proven to be a nice sane way 
to do resource-like (that is, non-include) class declarations that don't 
stomp on each other, and can involve a bit less action-at-a-distance than 
relying on Hiera's automatic parameter lookup.

You can probably get all your things done with either all-Hiera or 
all-roles/profiles, but I think most people are using a mixture. 

Hope that helps!

N

On Thursday, June 20, 2013 6:32:14 AM UTC-7, Dick Davies wrote:
>
> We just bumped up our master from 2.6 to 2.7 to get yesterdays 
> security fix, and I'm trying to clean up the Dynamic warnings ready 
> to push on to 3.x. 
>
> I've read 
>
> http://docs.puppetlabs.com/guides/scope_and_puppet.html 
>
> but can't see a good alternative for a pattern we use to allow tuneable 
> settings in our modules. 
> Generally we provide 'sane' default settings, but allow an including class 
> to override them like this: 
>
> class dynamic { 
>   $thingy_tunable = "non-default" 
>   include thingy 
> } 
>
> where thingy looks like: 
>
> class thingy { 
>   # overrideable defaults 
>   if $thingy_tunable { $tunable = $thingy_tunable } else { $tunable = 
> "default" } 
>   #  actual resources defined here . 
> } 
>
> Options I'm sort of aware of: 
>
> 1. parameterized classes - heard they don't work with include, which 
> would mean quite a lot of surgery. 
> 2. Hiera ALL the things - we've been using hiera to configure a fair 
> few modules, and it's been great. 
>  But we tend to use it for 
> 'node-specific globals' - I'm not sure how I could 
>  do per-module lookups using it 
> (without which we'd need a lot of repetition in the 
>  hierarchy. 
>
>
> As I said, we're looking to get to 3.x with PuppetDB asap - wondered 
> which of the 2 options above are 
> least likely to get in the way of that? 
>
> Thanks! 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] The handy Grail of Modules Standards

2013-06-20 Thread David Schmitt

On 2013-06-20 16:12, jcbollinger wrote:

I just have low regard for software that
doesn't yet exist. I do not find the potential for nebulous future
software a persuasive argument for adopting anything.


You might want to check out the significant amount of modules available 
at http://github.com/Example42 that are the source of these naming 
conventions.


Regards, David

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Templates modified on puppetmaster but clients not seeing changes

2013-06-20 Thread Phil Gardner
whoops, ignore 'include yum_new', the class is actually called that, I
was just trying to clean up the manifest a bit and forgot to do the same
in the nodes section.

On 06/20/2013 01:22 PM, Phil Gardner wrote:
> nodes.pp:
> 
> node /^testserver-.*/ {
>   $centos_version = '6.4'
>   $updates_enabled = '1'
>   include yum_new
> }
> 
> --
> 
> modules/yum/manifests/init.pp:
> 
> class yum {
>   file { 'CentOS-Base.repo':
> mode=> '0644',
> owner   => 'root',
> group   => 'root',
> path=> '/etc/yum.repos.d/CentOS-Base.repo',
> content => template('yum-new/CentOS-Base.repo.erb'),
> notify  => Exec['clean'],
>   }
>   exec { 'clean':
> command => 'yum clean all',
> path=> '/usr/bin/',
> refreshonly => true,
>   }
> }
> 
> --
> 
> modules/yum/templates/CentOS-Base.repo.erb:
> 
> [base]
> name=CentOS-$releasever - Base
> #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
> #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
> baseurl=http://yumrepo.<%= @datacenter %>.example.net/repos/centos/<%=
> centos_version %>/os/$basearch/
> gpgcheck=1
> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
> 
> #released updates
> [updates]
> name=CentOS-$releasever - Updates
> #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
> #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
> baseurl=http://yumrepo2.<%= @datacenter %>.example.net/repos/centos/<%=
> centos_version %>/updates/$basearch/
> enabled=<%= updates_enabled -%>
> gpgcheck=1
> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
> 
> --
> 
> On 06/20/2013 12:50 PM, Dan White wrote:
>> What's the manifest for the file resource, please ?
>> Could be any number of things
>>
>> “Sometimes I think the surest sign that intelligent life exists
>> elsewhere in the universe is that none of it has tried to contact us.”
>> Bill Waterson (Calvin & Hobbes)
>>
>> 
>> *From: *"Phil Gardner" 
>> *To: *puppet-users@googlegroups.com
>> *Sent: *Thursday, June 20, 2013 12:39:14 PM
>> *Subject: *[Puppet Users] Templates modified on puppetmaster but clients
>> not seeing changes
>>
>> Has anyone experienced this before? The template works fine and creates
>> the file no problem if the file doesn't exist, but it will not change
>> the file if I modify the template.
>>
>> My google-fu has come up short. Using 2.7.17.
>>
>>
>>
>> -- 
>> _
>> Phil Gardner
>> PGP Key ID 0xFECC890C
>> OTR Fingerprint 6707E9B8 BD6062D3 5010FE8B 36D614E3 D2F80538
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to puppet-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to puppet-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/puppet-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to puppet-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to puppet-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/puppet-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
> 

-- 
_
Phil Gardner
PGP Key ID 0xFECC890C
OTR Fingerprint 6707E9B8 BD6062D3 5010FE8B 36D614E3 D2F80538


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Templates modified on puppetmaster but clients not seeing changes

2013-06-20 Thread Phil Gardner
nodes.pp:

node /^testserver-.*/ {
  $centos_version = '6.4'
  $updates_enabled = '1'
  include yum_new
}

--

modules/yum/manifests/init.pp:

class yum {
  file { 'CentOS-Base.repo':
mode=> '0644',
owner   => 'root',
group   => 'root',
path=> '/etc/yum.repos.d/CentOS-Base.repo',
content => template('yum-new/CentOS-Base.repo.erb'),
notify  => Exec['clean'],
  }
  exec { 'clean':
command => 'yum clean all',
path=> '/usr/bin/',
refreshonly => true,
  }
}

--

modules/yum/templates/CentOS-Base.repo.erb:

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://yumrepo.<%= @datacenter %>.example.net/repos/centos/<%=
centos_version %>/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://yumrepo2.<%= @datacenter %>.example.net/repos/centos/<%=
centos_version %>/updates/$basearch/
enabled=<%= updates_enabled -%>
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

--

On 06/20/2013 12:50 PM, Dan White wrote:
> What's the manifest for the file resource, please ?
> Could be any number of things
> 
> “Sometimes I think the surest sign that intelligent life exists
> elsewhere in the universe is that none of it has tried to contact us.”
> Bill Waterson (Calvin & Hobbes)
> 
> 
> *From: *"Phil Gardner" 
> *To: *puppet-users@googlegroups.com
> *Sent: *Thursday, June 20, 2013 12:39:14 PM
> *Subject: *[Puppet Users] Templates modified on puppetmaster but clients
> not seeing changes
> 
> Has anyone experienced this before? The template works fine and creates
> the file no problem if the file doesn't exist, but it will not change
> the file if I modify the template.
> 
> My google-fu has come up short. Using 2.7.17.
> 
> 
> 
> -- 
> _
> Phil Gardner
> PGP Key ID 0xFECC890C
> OTR Fingerprint 6707E9B8 BD6062D3 5010FE8B 36D614E3 D2F80538
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
_
Phil Gardner
PGP Key ID 0xFECC890C
OTR Fingerprint 6707E9B8 BD6062D3 5010FE8B 36D614E3 D2F80538


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Templates modified on puppetmaster but clients not seeing changes

2013-06-20 Thread Dan White
What's the manifest for the file resource, please ? 
Could be any number of things 


“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.” 
Bill Waterson (Calvin & Hobbes) 

- Original Message -
From: "Phil Gardner"  
To: puppet-users@googlegroups.com 
Sent: Thursday, June 20, 2013 12:39:14 PM 
Subject: [Puppet Users] Templates modified on puppetmaster but clients not 
seeing changes 

Has anyone experienced this before? The template works fine and creates 
the file no problem if the file doesn't exist, but it will not change 
the file if I modify the template. 

My google-fu has come up short. Using 2.7.17. 



-- 
_ 
Phil Gardner 
PGP Key ID 0xFECC890C 
OTR Fingerprint 6707E9B8 BD6062D3 5010FE8B 36D614E3 D2F80538 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group. 
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com. 
To post to this group, send email to puppet-users@googlegroups.com. 
Visit this group at http://groups.google.com/group/puppet-users. 
For more options, visit https://groups.google.com/groups/opt_out. 


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Templates modified on puppetmaster but clients not seeing changes

2013-06-20 Thread Phil Gardner
Has anyone experienced this before? The template works fine and creates
the file no problem if the file doesn't exist, but it will not change
the file if I modify the template.

My google-fu has come up short. Using 2.7.17.



-- 
_
Phil Gardner
PGP Key ID 0xFECC890C
OTR Fingerprint 6707E9B8 BD6062D3 5010FE8B 36D614E3 D2F80538

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] The handy Grail of Modules Standards

2013-06-20 Thread Alessandro Franceschi


On Thursday, June 20, 2013 4:12:46 PM UTC+2, jcbollinger wrote:
>
>
>
> On Wednesday, June 19, 2013 5:34:58 PM UTC-5, Alessandro Franceschi wrote:
>>
>>
>>
>> On Wednesday, June 19, 2013 5:03:41 PM UTC+2, jcbollinger wrote:
>>>
>>>
>>> Call me "experienced", "jaded", or even "cynical", but I know of too 
>>> many instances of vaporware to be swayed by promises of software that 
>>> hasn't yet been written.
>>>
>>
>> I just call you cynical. We can't do anything if we don't try to do it.
>>  
>>
>
> By all means, do.  If you are somehow getting the impression that I object 
> to the project then I apologize.  Indeed, I encourage you to proceed, and I 
> wish you well.  I just have low regard for software that doesn't yet 
> exist.  I do not find the potential for nebulous future software a 
> persuasive argument for adopting anything.
>
> What I actually object to is misrepresentation -- even though accidental 
> -- of the nature and scope of the project.  It is NOT restricted to 
> choosing names.
>
> Secondarily, I object to positioning the effort as a standardization 
> project, and I advise you to position it differently.  Names and labels are 
> meaningful.  How the project proceeds, who participates, what they propose, 
> and all manner of intangibles will be influenced by your decisions in this 
> regard.  Frankly, I am inclined to resist a "standardization" effort from 
> any random third party, but I have no reason whatever to oppose anyone 
> drafting a set of conventions or best practices.  After they have been 
> tested in the field will be a suitable time to consider standardization or 
> endorsement.
>
>
>
>> *A really reusable module HAS to be parametrized*.
>>
>
>
> Utter hogwash.
>

Lol. Show me a real example of a reusable module without parametrized 
classes that at least manages a typical package/service/configuration file 
scenario.
Give me proofs, not words that I have to search on a dictionary.
 

>
>  
>
>> Take note, I can repeat and argument that anytime.
>>
>
>
> Then no doubt we'll be hearing from each other on this again.
>
>  
>
>> Parameters are the API of a module, the interface you can interact with 
>> it without touching it.
>> If you don't use parameters either you are forcing inside the module 
>> behaviours that can't be changed by users or you are forcing a specific way 
>> to obtain the data that affects the modules behaviour and this inherently 
>> makes it not reusable for people who provide data in other ways.
>>
>
>
> The data consumed by a module and the labels by which they are identified 
> are certainly parts of a module's API, but it is by no means necessary to 
> express those or interact with them in the form of class parameters.  You 
> cannot safely use parameterized-style class declarations (as opposed to 
> class *definitions*) of any API class, especially in or with modules 
> intended to be interoperable.  That makes parameterization largely moot as 
> far as reusability goes.  If people want to parameterize their classes then 
> I have no special reason to object.  I do object, however, to the premise 
> that doing so usefully improves reusability or interoperability, and 
> therefore I object to any proposal that expressly calls for classes to be 
> parameterized.
>
> As long as we're talking about standards, Hiera is Puppet's de facto 
> standard interface to external data.  It is usually expected that proposed 
> standards will build on other, existing standards, whether de facto or 
> formal.
>

Sadly, Hiera is not the only de facto standard interface to Puppet's 
external data. Variables set via an ENC are another widely used "standard".
Also I'd say that Hiera is standard with Puppet 3, not with earlier 
versions.
So please show me a reusable module without parameters and without hiera 
functions inside, as that would not be reusable by whoever does not use 
Hiera.


> I think your proposal would be stronger if it truly did focus on the data 
> that might need to be supported by modules and the names / labels / keys by 
> which they are identified.  If you choose a namespace-based system then you 
> can align it to be consistent with class parameterization and automated 
> parameter binding, yet not dependent on those.  I know you want more, but 
> you should consider making a separate effort of the rest.
>

I've no problems in concentrating in naming without "forcing" the usage of 
parametrized classes, but still have to figure out HOW to manage injection 
of external data to the module without using parameters (and without using 
hiera calls or references to arbitrary fully qualified variables names).
Curiously one of my efforts in the past has been exactly towards this 
direction, so I have actually a solution for that, but it still requires a 
parametrized class, even if you can use it with a simple include.


>  
>>
>>>
>>> Most importantly, however, my central objection here is that a proposal 
>>> that purports to be exclusively about 

Re: [Puppet Users] Re: Executing puppet crash the machine

2013-06-20 Thread Montse Seisdedos
Hello group:
We eventually performed the test John suggested and we caught  the "thief" 
-> virtual.rb 
We didn't even try to analyze why it is hanging the machine. Due to the 
fact that this facter is not being used in ours recipes we just dropped it 
out.
Thanks for you help. 


On Wednesday, November 28, 2012 5:41:00 PM UTC+1, Montse Seisdedos wrote:
>
> Hello John, 
> Your assumption is ok.
> I can not do the facter loop because we are in a production environment. 
> Every time I run puppet on this machines I make sure I can reach its IPMI 
> interface so I can reboot the machine in few minutes.
> Thanks for you help
> Regards.
>
>
> 2012/11/28 jcbollinger >
>
>>
>>
>> On Wednesday, November 28, 2012 4:49:13 AM UTC-6, Mon wrote:
>>>
>>> Hello John,
>>> Thanks for your answer. I have open an issue with my hardward 
>>> manufacturer and so I will do it with my SO one.
>>> Anyway I paste the strace listings so maybe someone can shed light on it:
>>>
>>> server1:
>>>
>>> BIOS: American Megatrends Inc. 1.2   
>>> SYS: Supermicro X8SIE
>>> CPU: Intel(R) Core(TM) i3 CPU 550 @ 3.20GHz [4 cores]
>>> MEM:
>>>   SLOT0  2048 MB
>>>   SLOT1  2048 MB
>>>
>>>
>>> open("/usr/lib/ruby/1.8/**facter/osfamily.rb", O_RDONLY|O_LARGEFILE) = 3
>>> close(3) = 0
>>> open("/usr/lib/ruby/1.8/**facter/osfamily.rb", O_RDONLY|O_LARGEFILE) = 3
>>> fstat64(3, {st_mode=S_IFREG|0644, st_size=800, ...}) = 0
>>> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
>>> 0) = 0xb7297000
>>> read(3, "# Fact: osfamily\n#\n# Purpose: Re"..., 4096) = 800
>>> ..CRASH 
>>>
>>>
>>> server2:
>>>
>>> BIOS: American Megatrends Inc. 1.2   
>>> SYS: Supermicro X8SIE
>>> CPU: Intel(R) Core(TM) i3 CPU 560 @ 3.33GHz [4 cores]
>>> MEM:
>>>   SLOT0  2048 MB
>>>   SLOT1  2048 MB
>>>
>>>
>>>
>>> stat64("/usr/sbin/dmidecode", {st_mode=S_IFREG|0755, st_size=48408, 
>>> ...}) = 0
>>> pipe([3, 4]) = 0
>>> clone(child_stack=0, 
>>> flags=CLONE_CHILD_CLEARTID|**CLONE_CHILD_SETTID|SIGCHLD, 
>>> child_tidptr=0xb74e5ba8) = 8709
>>> close(4) = 0
>>> fcntl64(3, F_GETFL) = 0 (flags O_RDONLY)
>>> fstat64(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
>>> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
>>> 0) = 0xb725e000
>>> _llseek(3, 0, 0xbf900930, SEEK_CUR) = -1 ESPIPE(Illegal seek)
>>> fstat64(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
>>> read(3, "# dmidecode 2.9\nSMBIOS 2.6 prese"..., 1024) = 1024
>>> read(3, "oot is supported\n\t\tBIOS boot spe"..., 1024) = 1024
>>> read(3, "tate: Safe\n\tThermal State: Safe\n"..., 1024) = 1024
>>> read(3, "Maximum Size: 128 KB\n\tSupported "..., 1024) = 1024
>>> read(3, "e 5, 28 bytes\nMemory Controller "..., 1024) = 1024
>>> read(3, " Installed\n\tError Status: OK\n\nHa"..., 1024) = 1024
>>> read(3, " type 8, 9 bytes\nPort Connector "..., 1024) = 1024
>>> read(3, "ternal Reference Designator: LPT"..., 1024) = 1024
>>> read(3, "nal Reference Designator: Not Sp"..., 1024) = 1024
>>> read(3, "nator: Not Specified\n\tExternal C"..., 1024) = 1024
>>> read(3, "or Type: None\n\tPort Type: Other\n"..., 1024) = 1024
>>> read(3, "ector Information\n\tInternal Refe"..., 1024) = 1024
>>> read(3, "\tLength: Short\n\tID: 1\n\tCharacter"..., 1024) = 1024
>>> read(3, "escriptor 5: POST error\n\tData Fo"..., 1024) = 1024
>>> read(3, "ype 19, 15 bytes\nMemory Array Ma"..., 1024) = 1024
>>> read(3, " Width: Unknown\n\tSize: No Module"..., 1024) = 1024
>>> read(3, "ry Device Mapped Address\n\tStarti"..., 1024) = 1024
>>> read(3, "on Handle: Not Provided\n\tTotal W"..., 1024) = 1024
>>> --- SIGCHLD (Child exited) @ 0 (0) ---
>>> read(3, "\n\nHandle 0x0039, DMI type 20, 19"..., 1024) = 1024
>>> read(3, "on-recoverable Threshold: 6\n\nHan"..., 1024) = 1024
>>> read(3, "UT OF SPEC>\n\tCooling Unit Group:"..., 1024) = 1024
>>> read(3, "ed: Yes\n\tHot Replaceable: No\n\tCo"..., 1024) = 669
>>> read(3, "", 1024) = 0
>>> close(3) = 0
>>> munmap(0xb725e000, 4096) = 0
>>> rt_sigaction(SIGHUP, {SIG_IGN}, {0xb77388f0, [HUP], SA_RESTART}, 8) = 0
>>> rt_sigaction(SIGQUIT, {SIG_IGN}, {0xb77388f0, [QUIT], SA_RESTART}, 8) = 0
>>> rt_sigaction(SIGINT, {SIG_IGN}, {0xb77388f0, [INT], SA_RESTART}, 8) = 0
>>> waitpid(8709, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 8709
>>> rt_sigaction(SIGHUP, {0xb77388f0, [HUP], SA_RESTART}, {SIG_IGN}, 8) = 0
>>> rt_sigaction(SIGQUIT, {0xb77388f0, [QUIT], SA_RESTART}, {SIG_IGN}, 8) = 0
>>> rt_sigaction(SIGINT, {0xb77388f0, [INT], SA_RESTART}, {SIG_IGN}, 8) = 0
>>> 
>>> sigprocmask(SIG_SETMASK, [], NULL) = 0
>>> sigprocmask(SIG_BLOCK, NULL, []) = 0
>>> sigprocmask(SIG_BLOCK, NULL, []) = 0
>>> sigprocmask(SIG_BLOCK, NULL, []) = 0
>>> sigprocmask(SIG_SETMASK, [], NULL) = 0
>>> sigprocmask(SIG_BLOCK, NULL, []) = 0
>>> sigprocmask(SIG_BLOCK, NULL, []) = 0
>>> sigprocmask(SIG_BLOCK, NULL, []) = 0
>>> .
>>> sigprocmask(SIG_BLOCK, NULL, []) = 0
>>> sigprocmask(SIG_BLOCK, NULL, []) = 0
>>> sigprocmask(SIG_BLOCK, NULL, []) = 0
>>> sigprocmask(SIG_BLOCK, NULL, []

Re: [Puppet Users] Set environment variable that is visible to package installation

2013-06-20 Thread Nikola Petrov
You can get the environment variable from puppet.conf or if it is
another variable, you can use facter. As long as you are controlling
your packages you can check those after that.

-- 
Nikola

On Wed, Jun 19, 2013 at 10:08:46AM -0700, Kevin Lange wrote:
> We have RPMs which requires an environment variable to be set prior to 
> installation (contains conf information).  What is the best way to do 
> this?  I'd like to avoid setting this environment var in each systems' 
> profile.  It would be nice to have an option to do this within the package 
> type, but I think that's not very likely.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] The handy Grail of Modules Standards

2013-06-20 Thread jcbollinger


On Wednesday, June 19, 2013 5:34:58 PM UTC-5, Alessandro Franceschi wrote:
>
>
>
> On Wednesday, June 19, 2013 5:03:41 PM UTC+2, jcbollinger wrote:
>>
>>
>> Call me "experienced", "jaded", or even "cynical", but I know of too many 
>> instances of vaporware to be swayed by promises of software that hasn't yet 
>> been written.
>>
>
> I just call you cynical. We can't do anything if we don't try to do it.
>  
>

By all means, do.  If you are somehow getting the impression that I object 
to the project then I apologize.  Indeed, I encourage you to proceed, and I 
wish you well.  I just have low regard for software that doesn't yet 
exist.  I do not find the potential for nebulous future software a 
persuasive argument for adopting anything.

What I actually object to is misrepresentation -- even though accidental -- 
of the nature and scope of the project.  It is NOT restricted to choosing 
names.

Secondarily, I object to positioning the effort as a standardization 
project, and I advise you to position it differently.  Names and labels are 
meaningful.  How the project proceeds, who participates, what they propose, 
and all manner of intangibles will be influenced by your decisions in this 
regard.  Frankly, I am inclined to resist a "standardization" effort from 
any random third party, but I have no reason whatever to oppose anyone 
drafting a set of conventions or best practices.  After they have been 
tested in the field will be a suitable time to consider standardization or 
endorsement.



> *A really reusable module HAS to be parametrized*.
>


Utter hogwash.

 

> Take note, I can repeat and argument that anytime.
>


Then no doubt we'll be hearing from each other on this again.

 

> Parameters are the API of a module, the interface you can interact with it 
> without touching it.
> If you don't use parameters either you are forcing inside the module 
> behaviours that can't be changed by users or you are forcing a specific way 
> to obtain the data that affects the modules behaviour and this inherently 
> makes it not reusable for people who provide data in other ways.
>


The data consumed by a module and the labels by which they are identified 
are certainly parts of a module's API, but it is by no means necessary to 
express those or interact with them in the form of class parameters.  You 
cannot safely use parameterized-style class declarations (as opposed to 
class *definitions*) of any API class, especially in or with modules 
intended to be interoperable.  That makes parameterization largely moot as 
far as reusability goes.  If people want to parameterize their classes then 
I have no special reason to object.  I do object, however, to the premise 
that doing so usefully improves reusability or interoperability, and 
therefore I object to any proposal that expressly calls for classes to be 
parameterized.

As long as we're talking about standards, Hiera is Puppet's de facto 
standard interface to external data.  It is usually expected that proposed 
standards will build on other, existing standards, whether de facto or 
formal.

I think your proposal would be stronger if it truly did focus on the data 
that might need to be supported by modules and the names / labels / keys by 
which they are identified.  If you choose a namespace-based system then you 
can align it to be consistent with class parameterization and automated 
parameter binding, yet not dependent on those.  I know you want more, but 
you should consider making a separate effort of the rest.

 
>
>>
>> Most importantly, however, my central objection here is that a proposal 
>> that purports to be exclusively about naming parameters in fact has any 
>> implications at all for module organization and style.
>>
>
> Ok, it's not a proposal that purports to be exclusively about naming 
> parameters: the usage of specific parameters involve patterns that enhance 
> modules' reusability  and interoperability.
> The sample module code definitively exposes design patterns with modules 
> (and it demonstrates that you can follow different patterns to achieve the 
> same behaviour.
>  
> Reading it again this is not so clear in the first post here, but it's 
> widely expressed in the linked pages.
> So, sorry, now let's move a step further, let's talk, if you want, about 
> how to make that paper/draft/proposal better.
> And if you think that such a thing should not even be discussed, well, ok, 
> I'll accept that and discuss it with who is interested in it.
>   
>


I think it would be better if it actually were narrowed in scope to 
identifying patterns in the data that modules consume, and choosing naming 
conventions for those data.  Better, and also easier to reach consensus 
on.  Include some comments about namespacing, especially in conjunction 
with accessing data via Hiera.  These issues are separate from and more 
fundamental than class parameterization or module organization.  They will, 
however, influence anyone who cho

Re: [Puppet Users] File directive

2013-06-20 Thread Matthew Burgess
On 20 June 2013 14:49, Roman Alekseev  wrote:

>
> What about a facter something like this:
>
> # nginx.rb
>
> Facter.add("nginx") do
>   setcode do
> Facter::Util::Resolution.exec(**'/usr/bin/dpkg -l  | /bin/grep -c
> nginx')
>   end
> end
>
>
A fact for something like that seems a bit over the top.  Is there a
reason you are not managing the package using Puppet? Martin's 2nd solution
is far more Puppet-like and is unlikely to cause any
head-scratching/confusion compared to your fact-based approach.

Regards,

Matt.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] File directive

2013-06-20 Thread Roman Alekseev

On 20.06.2013 17:46, Martin Alfke wrote:

  this case the file resource will only be managed if the package resource has 
been defined.
This does not mean, that the package has been installed successfully!
For this option you have to add
require => Package['nginx'],
to your file resource.


Thank you your solutions is great!
What about a facter something like this:

# nginx.rb

Facter.add("nginx") do
  setcode do
Facter::Util::Resolution.exec('/usr/bin/dpkg -l  | /bin/grep -c nginx')
  end
end

Thanks

--
Kind regards,

R. Alekseev

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] File directive

2013-06-20 Thread Martin Alfke
Hi Roman,

you can check for a defined package resource

if defined(Package['nginx']) {
  file { …… }
}

In this case the file resource will only be managed if the package resource has 
been defined.
This does not mean, that the package has been installed successfully!
For this option you have to add
require => Package['nginx'],
to your file resource.

hth,

Martin


On Jun 20, 2013, at 3:06 PM, Roman Alekseev  wrote:

> Hi Everyone,
> 
> Is it possible to use File directive only if some software is installed, 
> otherwise do nothing? 
> For example:
> 
> file { "/tmp/puppet-nginx-init.sh":
> ensure  => "present",
> owner   => "root",
> group   => "root",
> mode=> 0755,
> source  => 
> "puppet://$puppetserver/modules/nginx/puppet-nginx-init.sh",
> # only if nginx is installed
> 
> }
> 
> Thank you!
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] 2.7 Dynamic scoping warnings - which way should I jump?

2013-06-20 Thread Dick Davies
We just bumped up our master from 2.6 to 2.7 to get yesterdays
security fix, and I'm trying to clean up the Dynamic warnings ready
to push on to 3.x.

I've read

http://docs.puppetlabs.com/guides/scope_and_puppet.html

but can't see a good alternative for a pattern we use to allow tuneable
settings in our modules.
Generally we provide 'sane' default settings, but allow an including class
to override them like this:

class dynamic {
  $thingy_tunable = "non-default"
  include thingy
}

where thingy looks like:

class thingy {
  # overrideable defaults
  if $thingy_tunable { $tunable = $thingy_tunable } else { $tunable =
"default" }
  #  actual resources defined here .
}

Options I'm sort of aware of:

1. parameterized classes - heard they don't work with include, which
would mean quite a lot of surgery.
2. Hiera ALL the things - we've been using hiera to configure a fair
few modules, and it's been great.
 But we tend to use it for
'node-specific globals' - I'm not sure how I could
 do per-module lookups using it
(without which we'd need a lot of repetition in the
 hierarchy.


As I said, we're looking to get to 3.x with PuppetDB asap - wondered
which of the 2 options above are
least likely to get in the way of that?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] File directive

2013-06-20 Thread Roman Alekseev
Hi Everyone,

Is it possible to use File directive only if some software is installed, 
otherwise do nothing? 
For example:

file { "/tmp/puppet-nginx-init.sh":
ensure  => "present",
owner   => "root",
group   => "root",
mode=> 0755,
source  => 
"puppet://$puppetserver/modules/nginx/puppet-nginx-init.sh",
# only if nginx is installed

}

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Re: PuppetDB queries using custom facts

2013-06-20 Thread David Schmitt
Perhaps you have still an agent running who has loaded an older facter 
version?


The default expiration of nodes in puppetdb should be in the order of 
days, if it is even enabled by default.



Regards, D.

On 20.06.2013 10:19, Alexander Grushin wrote:

Interesting...

This fact returned using PuppetDB API query only after I run puppet
agent -t manually.
I believe this fact should appear after usual puppet agent daemon run
(every 10 minutes), but it doesn't.

And what is more interesting - those entries disappear after a while.
Looks like some expiration procedure in action?

$ curl -X GET -H 'Accept: application/json'
http://puppetdb:8080/v2/facts --data-urlencode 'query=["=", "name",
"appenvironment"]'
[ {
   "certname" : "web0.local",
   "name" : "appenvironment",
   "value" : "production"
}, {
   "certname" : "web98.local",
   "name" : "appenvironment",
   "value" : "production"
}, {
   "certname" : "web99.local",
   "name" : "appenvironment",
   "value" : "production"
} ]

After a while:

$ curl -X GET -H 'Accept: application/json'
http://puppetdb:8080/v2/facts --data-urlencode 'query=["=", "name",
"appenvironment"]'
[ {
   "certname" : "web97.local",
   "name" : "appenvironment",
   "value" : "production"
}, {
   "certname" : "web98.local",
   "name" : "appenvironment",
   "value" : "production"
} ]

And one more time:
$ curl -X GET -H 'Accept: application/json'
http://puppetdb:8080/v2/facts --data-urlencode 'query=["=", "name",
"appenvironment"]'
[ {
   "certname" : "web97.local",
   "name" : "appenvironment",
   "value" : "production"
} ]

--
You received this message because you are subscribed to the Google
Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: PuppetDB queries using custom facts

2013-06-20 Thread Alexander Grushin
Interesting...

This fact returned using PuppetDB API query only after I run puppet agent 
-t manually.
I believe this fact should appear after usual puppet agent daemon run 
(every 10 minutes), but it doesn't.

And what is more interesting - those entries disappear after a while. Looks 
like some expiration procedure in action?

$ curl -X GET -H 'Accept: application/json' http://puppetdb:8080/v2/facts 
--data-urlencode 'query=["=", "name", "appenvironment"]'
[ {
  "certname" : "web0.local",
  "name" : "appenvironment",
  "value" : "production"
}, {
  "certname" : "web98.local",
  "name" : "appenvironment",
  "value" : "production"
}, {
  "certname" : "web99.local",
  "name" : "appenvironment",
  "value" : "production"
} ]

After a while:

$ curl -X GET -H 'Accept: application/json' http://puppetdb:8080/v2/facts 
--data-urlencode 'query=["=", "name", "appenvironment"]'
[ {
  "certname" : "web97.local",
  "name" : "appenvironment",
  "value" : "production"
}, {
  "certname" : "web98.local",
  "name" : "appenvironment",
  "value" : "production"
} ]

And one more time:
$ curl -X GET -H 'Accept: application/json' http://puppetdb:8080/v2/facts 
--data-urlencode 'query=["=", "name", "appenvironment"]'
[ {
  "certname" : "web97.local",
  "name" : "appenvironment",
  "value" : "production"
} ]

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] PuppetDB queries using custom facts

2013-06-20 Thread Alexander Grushin
Yep, this was a cause.

Great! Thanks, David!

On Thursday, June 20, 2013 10:56:50 AM UTC+4, David Schmitt wrote:
>
> Hi, Alexander, 
>
> "environment" is a special variable. It denotes the puppet environment 
> that is used by the puppetmaster to multiplex into different module 
> directories. While I have not tested this, I would assume that this is 
> special cased by many code paths. 
>
> Your own example shows that the environment is not honored by the puppet 
> agent. 
>
> Just use a different name for the variable and use it to set the 
> environment in puppet.conf, if that's what you really want. 
>
>
> Regards, David 
>
> On 20.06.2013 08:46, Alexander Grushin wrote: 
> > Hi, all! 
> > 
> > I'm trying to use external facts from Facter 1.7 and everything looks 
> good: 
> > 
> > web0 $ cat /etc/facter/facts.d/environment.txt 
> > environment=productionweb0$ 
> > web0 $ facter environment 
> > production 
> > web0 # puppet agent -t 
> > Info: Retrieving plugin 
> > Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb 
> > [...] 
> > Notice: Environment name for web0 is production 
> > [...] 
> > Notice: Finished catalog run in 11.25 seconds 
> > 
> > But one thing do not leave me in peace - I can't use this fact in 
> > PuppetDB API queries, for some reasons it is not visible for PuppetDB: 
> > 
> > $ curl -X GET -H 'Accept: application/json' 
> > http://puppetdb:8080/v2/facts/environment 
> > $ 
> > 
> > Is somebody have an experience with using facts in puppetdb queries? Is 
> > it possible? 
> > 
> > Thanks! 
> > 
> > --- 
> > Alexander 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Puppet Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to puppet-users...@googlegroups.com . 
> > To post to this group, send email to 
> > puppet...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/puppet-users. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.