Re: [Puppet Users] What's the best practice to manage software updates using puppet ?

2013-09-25 Thread Frederiko Costa
What I particularly do is to make sure that every module has the $package_ensure class parameter set to 'present' by default. If I want a particular version, then I tell when I instantiate the class. One example would be: class a($package_ensure = 'present') { package { 'whatever-a' : ens

Re: [Puppet Users] symlink creation using facter, but facter is nil at first run.

2013-09-25 Thread Frederiko Costa
t. > > You'll still have a problem if the jdk package is updated by puppet, > however. In that case the fact would have the old version and try to ensure > that the link points to a non-existent target. Maybe there's a way to make > the exec work in that case, with a refresho

Re: [Puppet Users] Scoping issue?

2013-09-21 Thread Frederiko Costa
Hi, I believe it could be this way: define ssh_user($passwd, $key) { user { $name: ensure => present, managehome => true, password = $passwd ? { /\w+/ => $passwd, default => undef, } } I think you should also double check the class with a define in

[Puppet Users] symlink creation using facter, but facter is nil at first run.

2013-09-20 Thread Frederiko Costa
Hi all, I'm trying to find a better way to implement this, but I can't think of. I have a jdk module that requires to create a symlink to whatever version is the one installed. Say I install jdk-6u35, it will create something like /usr/java/jdk_1.6.35. I would like to create a symlink /usr/java/jd

Re: [Puppet Users] Re: Facter value at Catalog compilation

2013-09-20 Thread Frederiko Costa
:25 AM, Ellison Marks wrote: > Post the code for the custom fact? > > > On Thursday, September 19, 2013 2:23:15 PM UTC-7, Frederiko Costa wrote: >> >> Hi, >> >> I've got a facter shipped with a custom module. This factor returns the >> version of a de

[Puppet Users] Facter value at Catalog compilation

2013-09-19 Thread Frederiko Costa
Hi, I've got a facter shipped with a custom module. This factor returns the version of a determined package. It returns nil if the package is not installed yet. When running for the first time, assuming the package is not installed, the facter will be still nil. When referring to that facter in t

Re: [Puppet Users] if then statement within file resource

2013-09-05 Thread Frederiko Costa
Hi, I believe in that case you should use selectors to make it work. http://docs.puppetlabs.com/puppet/2.7/reference/lang_conditional.html#selectors Or you can use the 'if' outside the file resource. Something like this: $template_name = $manufacter ? { 'ibm' => "${module_name}/ibm.inittab.e

Re: [Puppet Users] basic case statement question

2013-09-05 Thread Frederiko Costa
Hi, To me, this would look like this. You're assigning the 'server' variable using =>, rather than =: class { '::ntp': case $timezone { 'PDT': { servers = [ '0.us.pool.ntp.org', '1.us.pool.ntp.org', ' 2.us.pool.ntp.org', '3.us.pool.ntp.org'] } default: { fa

Re: [Puppet Users] basic case statement question

2013-09-05 Thread Frederiko Costa
2013 at 11:15 AM, Greg Coit wrote: > Thank you for the reply Frederiko. Unfortunately, that doesn't seem to be > the issue. The following is from the pupetlabs/ntep docs and works: > > class { '::ntp': > servers => [ '0.us.pool.ntp.org', &#x

Re: [Puppet Users] Roles/profiles and hiera

2013-09-04 Thread Frederiko Costa
ly. Machines in dc1 get 1.2.3.1, > dc2 gets 1.4.5.1, and any machine gets 1.1.1.1. > > In summary we move data into Hiera and replace module::someclass::dc with > a simple module that does a lookup to a data file based on facts that have > classified the node. > > Ramin > &

Re: [Puppet Users] Roles/profiles and hiera

2013-09-03 Thread Frederiko Costa
... > } > } > > Then your hieradata would set > > in a.b.c.d.yaml: > profile::zabbix20::server::bind_ip: 1.2.2.3 > > in x.y.z.w.yaml: > profile::zabbix20::server::bind_ip: 1.2.3.4 > > That way you have a single profile for all datacenters. > > - Chad &

Re: [Puppet Users] Roles/profiles and hiera

2013-09-03 Thread Frederiko Costa
ually change the modules. Isn't it desirable to have these out of the modulespath? I don't see why we have to do this way if are trying to abstract things and avoiding touching modules whenever we can. Thanks in advance. On Friday, August 30, 2013 4:09:39 PM UTC-7, Ramin K wrote: >

[Puppet Users] Roles/profiles and hiera

2013-08-30 Thread Frederiko Costa
Hi everyone, Do you guys know any article/doc talking about the use of roles/profiles approach with hiera? I'm particularly interested in how to organize the manifests when having multiple data centers, parametized classes and wants to use hiera. Being even more specific, how to organize the cod

Re: [Puppet Users] Re: Service resource does not turn services off on reboots

2011-08-29 Thread Frederiko Costa
installation. I wonder if I missed something. Any other idea? thanks, -fred On Mon, Aug 29, 2011 at 7:27 AM, jcbollinger wrote: > > > On Aug 26, 1:26 pm, Frederiko Costa wrote: > > Hi folks, > > > > The question I have is regarding to Service resource on Red Ha

[Puppet Users] Service resource does disable services on reboots

2011-08-26 Thread Frederiko Costa
Hi folks, The question I have is regarding to Service resource on Red Hat systems. I have the following example: service { [ "anacron", "atd" ]: ensure => stopped, enable => false, hasrestart => true, hasstatus => true, } It runs fine, disabling the service while

Re: [Puppet Users] Exec resource not being applied properly

2011-08-26 Thread Frederiko Costa
selinux](provider=augeas): Closed the augeas connection thanks for the help! -fred On Fri, Aug 26, 2011 at 8:42 AM, Frederiko Costa wrote: > I tried both suggestions: egrep and adding the -e switch on sed, but none > worked. I'm going to try augeas ... > > -fred > >

[Puppet Users] Service resource does not seem to be disabling service on reboots

2011-08-26 Thread Frederiko Costa
Hi folks, The question I have is regarding to Service resource on Red Hat systems. I have the following: service { [ "anacron", "atd" ]: ensure => stopped, enable => false, hasrestart => true, hasstatus => true, } It runs fine, disabling the service while the sys

Re: [Puppet Users] Exec resource not being applied properly

2011-08-26 Thread Frederiko Costa
I tried both suggestions: egrep and adding the -e switch on sed, but none worked. I'm going to try augeas ... -fred On Fri, Aug 26, 2011 at 8:31 AM, Kinzel, David wrote: > > Hi folks, > > > > I have the following resource on my test environ: > > > > exec { "/bin/sed -i 's/^SELINUX=enforcing/S

Re: [Puppet Users] Exec resource not being applied properly

2011-08-26 Thread Frederiko Costa
; On Fri, Aug 26, 2011 at 8:25 AM, Frederiko Costa wrote: > >> Hi folks, >> >> Thanks for the quick help >> >> Aaron - the -i does an in place modification. If I run on the >> command-line, works fine. If I don't use -i, I would have to use some sort >

Re: [Puppet Users] Exec resource not being applied properly

2011-08-26 Thread Frederiko Costa
--in-place[=SUFFIX] edit files in place (makes backup if extension supplied)" Frank - I will read about the augeas type. As a newbie in Puppet, it was unknown to me. Thanks, -fred On Fri, Aug 26, 2011 at 8:16 AM, Frank Sweetser wrote: > On 08/26/2011 11:03 AM, Frederiko C

[Puppet Users] Exec resource not being applied properly

2011-08-26 Thread Frederiko Costa
Hi folks, I have the following resource on my test environ: exec { "/bin/sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config": path => [ '/usr/bin', '/bin' ], onlyif => "/bin/grep '^SELINUX=enforcing' /etc/sysconfig/selinux 2>/dev/null", logoutput => true, } Whenever

Re: [Puppet Users] enviroments are not being used

2011-08-15 Thread Frederiko Costa
in environment development in 0.07 seconds info: Caching node for X notice: Compiled catalog for XX in environment testing in 0.03 seconds thanks, -fred On Sat, Aug 13, 2011 at 1:15 AM, Stefan Schulte < stefan.schu...@taunusstein.net> wrote: > On Fri, Aug 12, 2011 at 02:39:37P

Re: [Puppet Users] Re: enviroments are not being used

2011-08-12 Thread Frederiko Costa
lopment] > > modulepath = /etc/puppet/environments/development/modules > > > > Thanks > > > > On Aug 12, 2:39 pm, Frederiko Costa wrote: > > > > > > > > > > > > > > > > > Hello everyone, > > > > > I h

[Puppet Users] enviroments are not being used

2011-08-12 Thread Frederiko Costa
Hello everyone, I have the following environments configured as master: # puppetmasterd -V 0.25.4 # cat puppet.conf [main] confir=/etc/puppet logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet pidfile=$rundir/puppetmasterd.pid factpath=$vardir/