Re: [Puppet Users] Recursive directory management

2011-07-08 Thread romuald FREBAULT
thank you very much, i'm gonna try this
and tell you

2011/7/7 Nan Liu n...@puppetlabs.com

 On Thu, Jul 7, 2011 at 9:43 AM, romuald FREBAULT kurgan...@gmail.com
 wrote:
  Hi,
 
  We decide to manage all our specific crons for applications with puppet.
  As all people who creates crons does'nt have to cope with puppet syntax,
 the
  easier way to do that seemed to be giving them a place on the
 puppetmaster
  where placing their crons, and deploying those crons in /etc/cron.d on
  nodes.
  That works fine, but i can't get a cron being removed on the node when
  removed on the puppetmaster.
 
  I can't use purge (it would be too easy ;-) because some package install
  crons in /etc/crons.d and we don't want to remove these crons, and we
 don't
  want to get them handle by puppet due to errors risk in case of
  update/upgrade
 
  has anyone an idea of how i could have managed files removed on
 destnation
  when removed from source without using the entierely purge function?
 

 Well just an idea and it's a bit hideous because I'm abusing resource
 behaviors, and please give it more testing and feedback. So the
 process:

 deploy cron jobs with .puppet extension
 touch any crontab files with puppet extentions (unless mask the Exec
 so it doesn't show up in logs).
 use tidy to clean up old *.puppet files.

 define cronfile ($content) {
  file { /etc/cron.d/${name}.puppet:
owner   = root,
group   = root,
mode= 0400,
content = $content,
  }
  exec { update_${name}_timestamp:
command = '/bin/false',
unless  = /bin/touch /etc/cron.d/${name}.puppet,
require = File[/etc/cron.d/${name}.puppet],
before  = Tidy['/etc/cron.d'],
  }
 }

 tidy { /etc/cron.d:
  age = 30m,
  recurse = 1,
  matches = [*.puppet],
 }

 cronfile { demo:
  content = * * * * * * /bin/true,
 }

 Set the tidy age to something sane so it doesn't remove files you just
 deployed (basically anything longer than a single puppet run), and
 this won't remove any files that doesn't have *.puppet extension.
 About the only thing to add is maybe ensure ntp timesync before you
 start touching any files. If you use cronfile custom resource it will
 deploy the cronjob in the right directory with appropriate extensions.

 Thanks,

 Nan

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



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



Re: [Puppet Users] Re: Checking for free disk space on mountpoint?

2011-07-08 Thread Victor Hooi
heya,

Excuse me if my understanding of your needs is completely out of whack :-). 
Maybe you want to describe what you want to do with this data once you have 
gathered it.

The reason we are doign this is to make sure that we have sufficient free 
disk space on various mountpoints to actually run the application on the 
server.

So this is something I'd like to enforce (or ensure) as part of the 
configuration. Which would best point to integrate this Facter-based check 
into a Puppet configuration for a node?

@Doug: Thanks heaps for your Facter script =). Hmm, the only thing is, 
ideally I'd like it to be cross-platform (Linux, Solaris and Windows) - it 
seems there isn't really a abstracted way of checking this in-built into 
Facter/Puppet, which is a shame.

We also need to check the file permissions on certain files, to make sure 
the application will run correctly. I searched and found this:

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

which seems to do the job.

I would have thought these two things (checking free disk space on various 
network mountpoints, and checking file/directory permissions) would be two 
fairly common tasks when configuring out boxes. How do people normally 
tackle this with Puppet?

Cheers,
Victor

-- 
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/-/bd3NjsTM6XwJ.
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: Checking for free disk space on mountpoint?

2011-07-08 Thread Ken Barber
 The reason we are doign this is to make sure that we have sufficient free
 disk space on various mountpoints to actually run the application on the
 server.

Oh - and your monitoring doesn't do this already?

 So this is something I'd like to enforce (or ensure) as part of the
 configuration. Which would best point to integrate this Facter-based check
 into a Puppet configuration for a node?

I guess so ... facter can be used as variables to decide if a
configuration can be applied. You could use conditionals to decide if
and service has ensure = running/stopped based on something from
facter using conditional. But this is during Puppet runtime only ...

 @Doug: Thanks heaps for your Facter script =). Hmm, the only thing is,
 ideally I'd like it to be cross-platform (Linux, Solaris and Windows) - it
 seems there isn't really a abstracted way of checking this in-built into
 Facter/Puppet, which is a shame.

Not necessarily. You can make decisions in Facter based on other
facts. 'operatingsystem' can be one of those facts. For example:

case Facter.value(:operatingsystem)
when Solaris
  # ... Solaris related lookup code
when centos, redhat
  # ... centos/redhat related df lookup code
else
  # ... some default behaviour
end

 We also need to check the file permissions on certain files, to make sure
 the application will run correctly. I searched and found this:
 http://projects.puppetlabs.com/projects/1/wiki/File_Permission_Check_Patterns

 which seems to do the job.
 I would have thought these two things (checking free disk space on various
 network mountpoints, and checking file/directory permissions) would be two
 fairly common tasks when configuring out boxes. How do people normally
 tackle this with Puppet?

I don't personally for application stop/start scripts. If I wanted to
I would put it in the system V startup script or whatever mechanism is
kicking around. That way it works for Puppet and human users who just
jump on a box and want to use the systems standard stop/start
mechanism.

Problem is - you do it all in Puppet ... only Puppet can stop and
start it. You could write start.pp and a stop.pp script if you wanted
and write all the scripting logic in Puppet I guess. Not normally done
though.

I can't say I have tested mount space before application start. I
usually rely on monitoring to tell me there is a problem there. Is
there a specific reason you need this, ie. avoid some odd corruption
during disk fulls or something? I would imagine the chances of
corruption during a disk full are much higher _after_ the
application has started and been running for a while though :-). Hence
why I guess I rely on monitoring more often ... monitoring will alert
me to a disk full even when I'm not trying to start the application.

ken.

-- 
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] Puppetmaster setup with separate CA server configuration help

2011-07-08 Thread linuxbsdfreak
Hi All,

I am setting up puppetmaster with nginx and passenger and separating
the Puppetmaster primary CA  server. I have 3 host

loadbalancer01 - Nginx doing LB on IP address and also running
puppetmaster with passenger under 127.0.0.1 (port 8140).
primaryca - Puppetmaster Primary CA
pclient - Puppet Client

The did the following steps:

On Primary CA server:


cd /var/lib/puppet/

puppetca generate
puppet cert -g loadbalancer01 --
certdnsnames=puppetmaster:loadbalancer01
puppet cert -g primaryca --certdnsnames=puppetmaster:primaryca

scp private_keys/loadbalancer01.pem root@loadbalancer01:/var/lib/
puppet/ssl/private_keys/
scp ca/signed/loadbalancer01.pem root@loadbalancer01:/var/lib/puppet/
ssl/certs/
scp ca/ca_crt.pem root@loadbalancer01:/var/lib/puppet/ssl/certs/ca.pem

On loadbalancer01
--
cd /var/lib/puppet
mkdir -p ssl/private_keys ssl/certs

 Following are the nginx/puppet.conf configs of loadbalancer01
--

[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl

[agent]
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
server = loadbalancer01
listen = true

[master]
   ssl_client_header = SSL_CLIENT_S_DN
   ssl_client_verify_header = SSL_CLIENT_VERIFY
   ca = false

-
Nginx.conf
---
user  nginx;
worker_processes  10;
worker_rlimit_nofile 10;

error_log  logs/error.log  info;
pidlogs/nginx.pid;

events {
worker_connections  1024;
use epoll;
}

http {

passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7;
passenger_ruby /usr/bin/ruby;

include   mime.types;
default_type  application/octet-stream;

## Common options ##
include options.conf;

## Proxy settings ##
include proxy.conf;

## lb domains ##
include puppetmasterlb.conf;

include lb01.conf;
}

- lb01.conf -

server {
listen  127.0.0.1:8140;
   # server_name  loadbalancer01;
root /etc/puppet/puppetmaster/public;
passenger_enabled on;
passenger_use_global_queue on;
rails_env production;

ssl off;

access_log /var/log/puppet/lb01_access.log;
error_log /var/log/puppet/lb01_error.log;
passenger_set_cgi_param SSL_CLIENT_S_DN
$ssl_client_s_dn;
passenger_set_cgi_param SSL_CLIENT_VERIFY
$ssl_client_verify;

   # make sure we serve everything as raw
types { }
default_type application/x-raw;

   # serve static file for the [files] mountpoint
location /production/file_content/files/ {
allow 192.168.122.0/24;
allow all;

alias /etc/puppet/files/;
}

# serve modules files sections
location ~ /production/file_content/[^/]+/files/ {
allow 192.168.122.0/24;
allow all;

root /etc/puppet/modules;

# rewrite /production/file_content/module/files/file.txt to /
module/file.text
rewrite ^/production/file_content/([^/]+)/files/(.+)$
$1/$2 break;
}
}

---  puppetmasterlb.conf --

# Backend puppetmasters and ca servers

upstream puppetmasters {
server  127.0.0.1:8140;
#   server  pserver02:8140;
}

   upstream puppetca {
server  primaryca:8140;
server  secondaryca:8140 backup;
}

server {
listen   192.168.122.14:8140;
server_name  loadbalancer01;

ssl on;
ssl_session_timeout 5m;
ssl_certificate /var/lib/puppet/ssl/certs/loadbalancer01.pem;
ssl_certificate_key /var/lib/puppet/ssl/private_keys/
loadbalancer01.pem;
ssl_client_certificate /var/lib/puppet/ssl/certs/ca.pem;
ssl_protocols  SSLv3 TLSv1;
ssl_ciphers  ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP;
ssl_prefer_server_ciphers   on;
ssl_verify_client optional;
ssl_verify_depth 1;

access_log  logs/loadbalancer01_access.log main;
error_log   logs/loadbalancer01_error.log;

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_headerX-Client-Verify  $ssl_client_verify;
proxy_set_headerX-Client-DN  $ssl_client_s_dn;
proxy_set_headerX-SSL-Subject$ssl_client_s_dn;
proxy_set_headerX-SSL-Issuer $ssl_client_i_dn;
proxy_buffer_size 16k;
proxy_buffers   8 32k;
proxy_busy_buffers_size64k;
proxy_temp_file_write_size 64k;
proxy_read_timeout  65;

location ^~ /production/certificate/ca {
proxy_pass https://puppetca;
}
   location ^~ /production/certificate {
proxy_pass 

Re: [Puppet Users] Recursive directory management

2011-07-08 Thread vagn scott

On 07/07/2011 12:43 PM, romuald FREBAULT wrote:


has anyone an idea of how i could have managed files removed on 
destnation when removed from source without using the entierely purge 
function?


What you want is a /etc/cron.puppet.d and a way to link files there
into /etc/cron.d (cron supports symlinks).  And you want the symlinks
to track the contents of the directory.  That way you can use purge.

You could write a script that runs on the client that does that.
Run it from cron, or trigger with puppet.  Something like:

$ cat track-with-links
#! /bin/bash

m=master# master directory
s=slave# slave directory

for f in $( ls $s )
do
[ ! -e $s/$f ]  echo removing $s/$f  rm -f $s/$f
done

for f in $( ls $m )
do
[ ! -e $s/$f ]  echo adding $s/$f  ln -fs ../$m/$f $s/$f
done



here is a test session:

vagn@nika:~/tmp$ ls master/ slave/
master/:
baz

slave/:
baz
vagn@nika:~/tmp$ touch master/foo ; rm master/baz
vagn@nika:~/tmp$ ./track-with-links ; ls master/ slave/
removing slave/baz
adding slave/foo
master/:
foo

slave/:
foo
vagn@nika:~/tmp$


--
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] Downgrading RubyGems using Package provider = gem

2011-07-08 Thread Ryan Conway
Hey everyone,

I'm experiencing an issue resulting from the way RubyGems works when
dealing with multiple gem versions.

When managing a gem through the Package provider, setting ensure to a
version lower than a currently installed version will result in Puppet
installing the older version, however RubyGems will also keep the
newer version, and this newer version will remain the default.

The issue was actually reported a couple of years ago, so I've updated
the original ticket:

http://projects.puppetlabs.com/issues/2061

I would like to see the Package provider have an option to remove
other versions of a gem it is managing, so that only the version you
specify remains.

Has anyone else experienced this issue, or have any thoughts?

Thanks,
Ryan

-- 
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] add lines to /etc/hosts on client

2011-07-08 Thread newguy
Hi guys
Am new to puppet so please take it easy on me.
I want to know how can I add lines to hosts file on the client
machine, I am trying to add a couple of IP addresses to the hosts file
on client and I dont want to overwrite their hosts file, just add new
stuff in there.
My server and client both are running Ubuntu.

Thanks

-- 
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] add lines to /etc/hosts on client

2011-07-08 Thread Ken Barber
You can add new entries using the 'host' type:

http://docs.puppetlabs.com/references/stable/type.html#host

For example:

host { myhostname:
  ip = 1.1.1.1,
}

By itself, it won't remove existing entries (but there is a way to do
this as well using purging).

If you haven't read it already, there is a language guide which
explains using resources in more detail:

http://docs.puppetlabs.com/guides/language_guide.html#resources

ken.

On Fri, Jul 8, 2011 at 3:45 PM, newguy aimanparv...@gmail.com wrote:
 Hi guys
 Am new to puppet so please take it easy on me.
 I want to know how can I add lines to hosts file on the client
 machine, I am trying to add a couple of IP addresses to the hosts file
 on client and I dont want to overwrite their hosts file, just add new
 stuff in there.
 My server and client both are running Ubuntu.

 Thanks

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





-- 
Join us for PuppetConf, September 22nd and 23rd in Portland, OR:
http://bit.ly/puppetconfsig;

-- 
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] Downgrading RubyGems using Package provider = gem

2011-07-08 Thread Martin Willemsma
Hi Ryan,

I experience the same. I'm using gem provider to manage puppet and
facter installed versions. When I recently upgraded a selection of
nodes to 2.7.1 I saw other not being removed like the way apt is
doing.

I would like to see what you purpose. Ensure = 2.7.1 also removes 2.6.8, 2.6.4

---

Martin

2011/7/8 Ryan Conway ryan.con...@forward.co.uk:
 Hey everyone,

 I'm experiencing an issue resulting from the way RubyGems works when
 dealing with multiple gem versions.

 When managing a gem through the Package provider, setting ensure to a
 version lower than a currently installed version will result in Puppet
 installing the older version, however RubyGems will also keep the
 newer version, and this newer version will remain the default.

 The issue was actually reported a couple of years ago, so I've updated
 the original ticket:

 http://projects.puppetlabs.com/issues/2061

 I would like to see the Package provider have an option to remove
 other versions of a gem it is managing, so that only the version you
 specify remains.

 Has anyone else experienced this issue, or have any thoughts?

 Thanks,
 Ryan

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



[Puppet Users] CSWfacter 1.6.0

2011-07-08 Thread Mark Phillips
Folks,

OpenCSW have released Facter 1.6.0 for Solaris - this includes a back port of 
the patch for issue 7038[1].

It's been released to the current catalog, but for now you can pick it up at 
http://buildfarm.opencsw.org/experimental/html#markp

Regards,

--Mark

[1] http://projects.puppetlabs.com/issues/7038

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



[Puppet Users] Re: add lines to /etc/hosts on client

2011-07-08 Thread newguy
Thanks for this help Ken, one more question please, suppose I want to
add the following lines in the smb.conf file already existing on the
client machine:

[USERNAME]
path = /home/USERNAME
available = yes
valid users = XYZ
read only =yes

How can I add lines to smb.conf with out overwriting the content of
the file.



On Jul 8, 7:48 am, Ken Barber k...@puppetlabs.com wrote:
 You can add new entries using the 'host' type:

 http://docs.puppetlabs.com/references/stable/type.html#host

 For example:

 host { myhostname:
   ip = 1.1.1.1,

 }

 By itself, it won't remove existing entries (but there is a way to do
 this as well using purging).

 If you haven't read it already, there is a language guide which
 explains using resources in more detail:

 http://docs.puppetlabs.com/guides/language_guide.html#resources

 ken.









 On Fri, Jul 8, 2011 at 3:45 PM, newguy aimanparv...@gmail.com wrote:
  Hi guys
  Am new to puppet so please take it easy on me.
  I want to know how can I add lines to hosts file on the client
  machine, I am trying to add a couple of IP addresses to the hosts file
  on client and I dont want to overwrite their hosts file, just add new
  stuff in there.
  My server and client both are running Ubuntu.

  Thanks

  --
  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 
  athttp://groups.google.com/group/puppet-users?hl=en.

 --
 Join us for PuppetConf, September 22nd and 23rd in Portland, 
 OR:http://bit.ly/puppetconfsig;

-- 
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: add lines to /etc/hosts on client

2011-07-08 Thread Rob McBroom
On Jul 8, 2011, at 12:45 PM, newguy wrote:

 How can I add lines to smb.conf with out overwriting the content of
 the file.

I think Augeas is what you’re looking for (for this and other inevitable use 
cases).

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

-- 
Rob McBroom
http://www.skurfer.com/


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



[Puppet Users] Re: add lines to /etc/hosts on client

2011-07-08 Thread newguy
Thanks Rob but what if I simple decide to remove the existing smb.conf
file and push the new smb.conf from the server, I know I can use the
source to tell which file to install and its location but how would I
remove the smb.conf from the client.


On Jul 8, 9:54 am, Rob McBroom mailingli...@skurfer.com wrote:
 On Jul 8, 2011, at 12:45 PM, newguy wrote:

  How can I add lines to smb.conf with out overwriting the content of
  the file.

 I think Augeas is what you’re looking for (for this and other inevitable use 
 cases).

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

 --
 Rob McBroom
 http://www.skurfer.com/

-- 
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: add lines to /etc/hosts on client

2011-07-08 Thread Rob McBroom
On Jul 8, 2011, at 1:52 PM, newguy wrote:

 Thanks Rob but what if I simple decide to remove the existing smb.conf
 file and push the new smb.conf from the server, I know I can use the
 source to tell which file to install and its location but how would I
 remove the smb.conf from the client.

If you push a file from the server, the old one will be completely replaced (if 
there are any differences between it and the new one). The original should get 
stored away in the client’s file bucket. If you want to remove a file only, you 
can use “ensure = absent”. I’m not sure what you’re asking, but hopefully the 
answer’s in there somewhere.

-- 
Rob McBroom
http://www.skurfer.com/

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



[Puppet Users] Re: add lines to /etc/hosts on client

2011-07-08 Thread newguy
Rob I am writing a module for installing Haproxy on client machine and
I want modified haproxy.cfg and modified /etc/init.d/haproxy to be
installed on the client. Here is my code but teh files are not getting
to the client machine:
class haproxy::install {
package { haproxy:
ensure =present,
}

}


class haproxy::init {
file { /etc/init.d/haproxy:
ensure = present,
owner = 'root',
group = 'root',
mode = 0600,
source = puppet:///modules/haproxy/haroxy,
require = Class[haproxy::install],
}
}

class haproxy::cfg {

file { /etc/haproxy/haproxy.cfg:
ensure = present,
owner = 'root',
group = 'root',
mode = 0600,
source = puppet:///modules/haproxy/haroxy.cfg,
require = Class[haproxy::install],
}

}
class haproxy {
include haproxy::install, haproxy::init, haproxy::cfg
}

Client shows the following error:
err: //haproxy::init/File[/etc/init.d/haproxy]: Failed to retrieve
current state of resource: Could not retrieve information from
source(s) puppet:///modules/haproxy/haroxy at /etc/puppet/modules/
haproxy/manifests/init.pp:17
err: //haproxy::cfg/File[/etc/haproxy/haproxy.cfg]: Failed to retrieve
current state of resource: Could not retrieve information from
source(s) puppet:///modules/haproxy/haroxy.cfg at /etc/puppet/modules/
haproxy/manifests/init.pp:29



On Jul 8, 11:04 am, Rob McBroom mailingli...@skurfer.com wrote:
 On Jul 8, 2011, at 1:52 PM, newguy wrote:

  Thanks Rob but what if I simple decide to remove the existing smb.conf
  file and push the new smb.conf from the server, I know I can use the
  source to tell which file to install and its location but how would I
  remove the smb.conf from the client.

 If you push a file from the server, the old one will be completely replaced 
 (if there are any differences between it and the new one). The original 
 should get stored away in the client’s file bucket. If you want to remove a 
 file only, you can use “ensure = absent”. I’m not sure what you’re asking, 
 but hopefully the answer’s in there somewhere.

 --
 Rob McBroom
 http://www.skurfer.com/

-- 
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: add lines to /etc/hosts on client

2011-07-08 Thread Jacob Helwig
On Fri, 08 Jul 2011 11:18:57 -0700, newguy wrote:
 
 class haproxy::init {
   file { /etc/init.d/haproxy:
   ensure = present,
   owner = 'root',
   group = 'root',
   mode = 0600,
   source = puppet:///modules/haproxy/haroxy,

Got a typo in the source URI here.  Should be 'haproxy', instead of
'haroxy' at the end.


-- 
Jacob Helwig


signature.asc
Description: Digital signature


[Puppet Users] Re: add lines to /etc/hosts on client

2011-07-08 Thread newguy
Thanks dude, there was another typo too, fixed both and it worked,
thanks everyone.

On Jul 8, 11:22 am, Jacob Helwig ja...@puppetlabs.com wrote:
 On Fri, 08 Jul 2011 11:18:57 -0700, newguy wrote:

  class haproxy::init {
     file { /etc/init.d/haproxy:
             ensure = present,
             owner = 'root',
             group = 'root',
             mode = 0600,
             source = puppet:///modules/haproxy/haroxy,

 Got a typo in the source URI here.  Should be 'haproxy', instead of
 'haroxy' at the end.

 --
 Jacob Helwig

  signature.asc
  1KViewDownload

-- 
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] Passing variables between stages

2011-07-08 Thread Chip Schweiss
That leads to the next question.

How to access a variable set in the node declaration from a class that
executes in the post stage?

On Thu, Jul 7, 2011 at 11:51 PM, vagn scott vagnsc...@gmail.com wrote:


 That sounds suspiciously like procedural thinking about a declarative
 language.

 You should understand that in puppet everything is 'set' before anything is
 'done'.
 Stages just help to order the 'get it done' part.

 So the answer to your question about a method to access a variable is:
  just access it!

$foo = $otherclass::baz

 --
 vagn




 On 07/07/2011 09:19 AM, Chip Schweiss wrote:

 I'm looking for a method to access a variable set in my main state from a
 class in my post stage?


 --
 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+unsubscribe@**
 googlegroups.com puppet-users%2bunsubscr...@googlegroups.com.
 For more options, visit this group at http://groups.google.com/**
 group/puppet-users?hl=enhttp://groups.google.com/group/puppet-users?hl=en
 .



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



[Puppet Users] Explanation of the metric section of a report

2011-07-08 Thread Haitao Jiang
I just wondering if anyone can point me to the documentation on the
metric section of a report. I have a slow agent run which has
following numbers:

Config Retrieval10.43 seconds
Exec0.00 seconds
File157.11 seconds
Filebucket  0.00 seconds
Package 0.07 seconds
Schedule0.00 seconds
Total   167.62 seconds

I would like to know meaning of above in order to find out the reasons
of slowness. My guess is it was due to the network latency, but just
want to make sure.

Thanks

Haitao

-- 
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] Passing variables between stages

2011-07-08 Thread vagn scott

On 07/08/2011 04:10 PM, Chip Schweiss wrote:


How to access a variable set in the node declaration from a class that 
executes in the post stage? 


The answer is the same whether you use stages or not.

Put your variables in a class.Below was tested on
puppet 2.7.1.  Per node stuff (eg mood) has to be passed in
the argument list.  Site wide stuff can be defined in the
body of class config.

node vm01 {

class { 'config': mood = grumpy, }
class { 'sleepy': stage = post, }

notice(done with vm01)

}

class config($mood) {

$h = { a = aaa, b = bbb }
$nodefoo = this is nodefoo
}


class sleepy {

$foo = $config::mood
$baz = $config::nodefoo

notice(dopey feels ${foo})
notice(nodefoo is: ${baz})
notice(b is ${$config::h[ 'b' ]})

}

Jul  8 17:58:39 gena puppet-master[23503]: (Scope(Class[Sleepy])) dopey 
feels grumpy
Jul  8 17:58:39 gena puppet-master[23503]: (Scope(Class[Sleepy])) 
nodefoo is: this is nodefoo

Jul  8 17:58:39 gena puppet-master[23503]: (Scope(Class[Sleepy])) b is bbb
Jul  8 17:58:39 gena puppet-master[23503]: (Scope(Node[vm01.lan3])) done 
with vm01
Jul  8 17:58:39 gena puppet-master[23503]: Compiled catalog for 
vm01.lan3 in environment production in 0.27 seconds



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