Fwd: [Puppet Users] Re: Customizing a hostname facts

2012-04-07 Thread Mukul Malhotra
Hi,

Actually I want that nobody in my network can change the hostname as some
has already changed the hostname of their node so
I want to restrict a check that nobody in the network or outside network
can change the hostname as they are already provided the sudo access as per
requirement. Also all the nodes in the network are configured with
serialnumber.

Can you elaborate more that how "serialnumber" custom fact can be written &
the same will be loaded through puppet for every node in the network.

Thanks
mac01




On Thu, Apr 5, 2012 at 6:47 PM, jcbollinger 
wrote:



On Apr 5, 1:39 am, mac01  wrote:
> Hi,
>

> I am trying to override a hostname.rp from path: *
> /usr/lib/ruby/site_ruby/1.8/facter* as,

>
> Facter.add(:hostname) do
>   confine :hostname => "serialnumber"
>   setcode do
> Facter::Util::Resolution.exec('cat /sys/power/states')
>   end
> end
>
> Is the fact code correct as I want puppet to pick serialnumber instead of
hostname from facter ?



You are trying to confine the 'hostname' fact based on the value of
that same fact.  I don't see how that could possibly work.  Either it
will throw Facter into an infinite loop, or that version of the fact
will just never be chosen.

There is probably a better approach to your problem than redefining
the hostname fact.  Not knowing what your actual problem is, I can
only speculate, but you might be better off creating and using a
"serialnumber" custom fact.  You might also want to look into Puppet's
"certname" parameter.


John


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

** **

--
Email Disclaimer: www.stjude.org/emaildisclaimer

-- 
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] Is Hiera the right tool for this ?

2012-04-07 Thread Jeff


Hi puppeteers,

I’m starting from scratch with Puppet 2.7 and I’m trying to avoid some 
pitfalls from the past using another configuration management tool.  I 
think most of the issues I had could be solved by Puppet and Hiera but 
being new to the tool and the approach, Im seeking for advice.

I have a common use case with the configuration of sysctl settings I 
believe will help me understand if Hiera is the right tool or approach to 
the problem.   Now the requirements are :

1) All nodes get a set of default settings

2) Based on facts such as function/application, settings are added 
incrementally

3) A default setting might be overridden for a specific use.

 

The ‘old’ way I used to solve this was through templating and lots if/else 
statements… but that’s exactly what Im trying to avoid as the knowledge 
about the infrastructure gets spread everywhere.

 When I found about the Puppet and Augeas combination I thought that was 
the solution.  I also wanted an ENC and using hiera sound great also.

 So here’s the hiera config :

---

:hierarchy:

- %{fqdn}

- %{os}

- %{role}

- %{datacenter}

- common

:backends:

- yaml

:yaml:

:datadir: '/etc/puppet/hieradata'

 

The common sysctl are in common.yaml:

classes:

- sysctl

sysctl_settings:

 net.ipv4.ip_forward:

value: 0

 kernel.randomize_va_space:

value: 1

 net.ipv4.conf.all.send_redirects:

value: 0

 

The more specific and possibly overriding parameters are in role-ap.yaml:

classes:

- sysctl

 

sysctl_settings:

  vm.swapiness:

 value: 0

  net.ipv4.ip_forward:

 value: 1


The sysctl wrapper module :


class sysctl {

create_resources( sysctl::config, hiera('sysctl_settings') )

}

define sysctl::config ($value) {

 augeas { "sysctl_${name}":

 context => "/files/etc/sysctl.conf",

 lens=> "sysctl.lns",

 incl=> "/etc/sysctl.conf",

 changes => [ "set ${name} ${value}" ],

 }

}

 Now the issue is that only the settings found in role-ap.yaml are applied.   
It looks like hiera stops at the first array matching in the hierarchy.   Did 
I got this all wrong?   

 The other issue with this approach is I can’t define a ‘’sysctl_${name}’ 
resource twice so overriding a parameter doesn’t work either.  How can I 
get the same result as with capitalization of a File resource for example?

Thanks to all, 

-- 
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/-/U9d-1z3AVTUJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Puppet and Passenger

2012-04-07 Thread Jax01
Hi Everyone;

I am new to puppet and would SO appreciate any help you might be able
to provide!

I am attempting to configure Passenger.  I have followed all of the
installation instructions but, when I restart my webserver, it does
not start the puppetmaster nor does it throw any errors.  So, I am not
even sure where to begin to look.

Also, some of the documentation refers to the puppetmaster.conf file.
I am not sure what this is.  I have only a puppet.conf file on the
puppetmaster which contains the required entries for the master.  Am I
missing something here?

Any help you could provide would be so greatly appreciated.

Thank you!

-- 
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 and Passenger

2012-04-07 Thread Christopher Wood
http://apt.puppetlabs.com/

Use that and then "apt-get install puppetmaster-passenger". (There's a yum 
repository too.) Then you can crib from those configs.

On Fri, Apr 06, 2012 at 05:45:39PM -0700, Jax01 wrote:
> Hi Everyone;
> 
> I am new to puppet and would SO appreciate any help you might be able
> to provide!
> 
> I am attempting to configure Passenger.  I have followed all of the
> installation instructions but, when I restart my webserver, it does
> not start the puppetmaster nor does it throw any errors.  So, I am not
> even sure where to begin to look.
> 
> Also, some of the documentation refers to the puppetmaster.conf file.
> I am not sure what this is.  I have only a puppet.conf file on the
> puppetmaster which contains the required entries for the master.  Am I
> missing something here?
> 
> Any help you could provide would be so greatly appreciated.
> 
> Thank you!
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
> 
> 

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



Re: [Puppet Users] Puppet and Passenger

2012-04-07 Thread Gabriel Filion
On 12-04-07 10:43 AM, Christopher Wood wrote:
> http://apt.puppetlabs.com/
> 
> Use that and then "apt-get install puppetmaster-passenger". (There's a yum 
> repository too.) Then you can crib from those configs.

oh, interesting, I didnt' know about this one.. and it's available in
squeeze-backports, too:

http://packages.debian.org/squeeze-backports/puppetmaster-passenger


Jax01: if you'd still like to try it out the long way (and thus
understand what's happening), you can follow that doc:

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

hopefully it's still all applicable as-is to puppet 2.6 and 2.7 (most of
it should be..)

generally, for debian you apt-get install apache2
libapache2-mod-passenger and rails, then you setup your apache
virtualhost file to trigger passenger, and finally, there's one config
file for passenger to know where to find puppet's main executable and
librairies.


also, the puppet master configuration file is named puppet.conf, too.
there's only a section more in there giving setup info about the master.
in puppet 2.6+ this section is called "[master]". see:

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


hth.

> On Fri, Apr 06, 2012 at 05:45:39PM -0700, Jax01 wrote:
>> Hi Everyone;
>>
>> I am new to puppet and would SO appreciate any help you might be able
>> to provide!
>>
>> I am attempting to configure Passenger.  I have followed all of the
>> installation instructions but, when I restart my webserver, it does
>> not start the puppetmaster nor does it throw any errors.  So, I am not
>> even sure where to begin to look.
>>
>> Also, some of the documentation refers to the puppetmaster.conf file.
>> I am not sure what this is.  I have only a puppet.conf file on the
>> puppetmaster which contains the required entries for the master.  Am I
>> missing something here?
>>
>> Any help you could provide would be so greatly appreciated.
>>
>> Thank you!
>>
>> -- 
>> 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.
>>
>>
> 

-- 
Gabriel Filion

-- 
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: Why latest stable Debian Squeeze package is 2.6.2-5+squeeze4 please ?

2012-04-07 Thread Michael Stahnke
On Thu, Apr 5, 2012 at 10:34 PM, Christophe L  wrote:
> Thank you all for your answers !
>
> As a suggestion for the documentation, that would be nice to have
> information about the http://apt.puppetlabs.com/ apt repository on the
> puppet installation page.

That is currently undergoing some work, and will be there.  If you
happen to know pages exactly you were referencing, I'll be sure to
them updated.

Mike

>
> Best regards,
> Christophe
>
> On 5 avr, 20:58, Gabriel Filion  wrote:
>> On 12-04-05 07:19 AM, Christophe L wrote:
>>
>> > After some research, I have found that the last stable debian package
>> > version is
>> > puppet (2.6.2-5+squeeze4) [security]
>> >http://packages.debian.org/squeeze/puppet
>>
>> > and that 2.7.12-3 is considered as unstable
>> >http://packages.qa.debian.org/p/puppet.html
>>
>> In Debian's release cycle, the packages are freezed before a release.
>> when this happens it means that package versions that are currently in
>> the "testing" branch will be used for the next debian release, and will
>> be used until the next release.
>>
>> the "stable" part in all that is the debian branch name that represents
>> the current release, so what software they support.
>>
>> security patches will be backported to 2.6 as much as possible for as
>> long as the current "stable" branch is the current one.
>>
>> for now, you can use the squeeze-backports[1] branch, in which you can
>> find puppet 2.7
>>
>> [1]:http://backports-master.debian.org/Instructions/
>>
>> --
>> Gabriel Filion
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>

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



Re: [Puppet Users] Getting started

2012-04-07 Thread Michael Stahnke
On Fri, Apr 6, 2012 at 7:40 AM, Andreas Haerter
 wrote:
> Hi,
>
> On 05.04.2012 22:42, Brown, Rodrick wrote:
>> I really hate poor documentation.
>>
>> I’m following along in PDF documentation I downloaded from the official
>> site and I’m stuck after I installed rack & passenger modules from
>> rubygems.
>
> There is a PDF?! OK...
>
> However, Maybe helpful:
> 
> -> "How to start" listing
>
>
>> I ran the passenger build script and it compiled and installed into my
>> local apache httpd server successfully.
>
> I personally started by using Puppet without master but "puppet apply"
> instead. I created modules and then ran something like
>
>> su -
>> puppet apply --verbose --modulepath /your/modules-directory/ -e "class { 
>> 'example': } foobar { [...] }"
>
> to learn the stuff before creating master infrastructure and stuff.
> BTW: There are masterless users out there (cf. "Masterless" listing at
> my blog posting linked above).
>
>
>> Puppet seems way too clumber some with the amount of dependencies
>> required so far.
>
> Seriously: use the packages of your distribution or the YUM/APT repos by
> Puppetlabs if you want to start with all the 2.7 features right now (I
> would recommend that - why learning and maintain old stuff if you just
> start to use Puppet?). Or are you running Puppet on windows (=no
> repositories available)?
But an MSI is available for windows: http://downloads.puppetlabs.com/windows


>
> --
> Andreas 
>
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.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] node-specific resources outside of a general-purpose module

2012-04-07 Thread Jonathon Anderson
I think there's something simple I'm missing about module best practices 
and application to nodes.

Let's assume I've been a good module developer: I have a general-purpose 
module with no site- or node-specific knowledge, and it defines a number of 
classes (generalized with parameters, extlookup, hiera, whatever) and a few 
defined types.

I can apply these classes--even parameterized classes--with an ENC, but, so 
far as I understand, I can't apply defined types directly to a node.  I 
need a class that contains those defined types that I would then apply to 
the node.

So what is that class?  What sort of name should it have?  By its very 
nature, it is either node- or site-specific, right?  Thus far, I've used 
modules at `/etc/puppet/services` using an `s_` prefix, kind of like what's 
described 
at http://projects.puppetlabs.com/projects/1/wiki/Puppet_Best_Practice2, 
but I get the feeling that that is not actually what is intended.

So what *is* intended?

~jonathon

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