Re: [Puppet Users] Meeting Puppet contractors

2014-03-11 Thread Jon Forrest

On 3/11/2014 9:24 AM, Brandon Clark wrote:

I'm not clear on what the etiquette is here but I was hoping to reach
out to the puppet community to see if there are any sysops people here
who are looking for work. My current admin recently got a new job and
moved on so I have need of a replacement person with puppet experience.
If these kinds of posts are not welcome I understand if it needs to be
moderated. Perhaps I can get a recommendation of where I can meet
potential contractors? Thanks


I personally have no problem with this but I think you should
say something about where the job is located, or whether telecommuting
is allowed.

Jon Forrest


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/531FD336.4050302%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Problems in Ch. 7 of Pro Puppet 2nd Edition

2014-03-11 Thread Jon Forrest

Here are the issues I found in Chapter 7. Short chapter - many typos.
Only 5 more chapters to go.

Jon Forrest

M = mistake
U = unclear
T = typo
E = text change
C = comment

(M) Pg. 169 "an external node carrier (ENC)" ->
"an external node classifier (ENC)"

(C) Pg. 169 "integrated data center lifecycle management tool"
This is a meaningless phrase.

(E) Pg. 170 "The Foreman installer currently does not support 
MCollective or PuppetDB installation" ->

"The Foreman installer currently does not install MCollective or PuppetDB"

(C) Pg. 172 "Foreman will be accessible at https://fqdn/";
You should make it clear here that "fqdn" should be replaced by the 
hostname of the
host running Foreman. You mention this instead on the next page, but 
that's too late.


(T) Pg. 172 "add your foreman server" ->
"add your Foreman server"

(C) Pg. 172 Why should provisioning be disabled? I'm not saying this is 
wrong but

it would be nice to know why.

(E) Pg. 175 "it will drill down" ->
"Foreman will drill down"

(E) Pg. 176 "The Foreman behaves as an ENC" ->
"Foreman behaves as an ENC"
(Using been using "Foreman" without "the" up to now.
Be consistent. This mistake occurs more than once on this page.)

(U) Pg. 178 What's an "eventful report"?

(U) Pg. 178 Why does "pro-puppet-foreman-client1.lan" appear twice in 
Figure 7-10?
I would expect there to be one entry per client. If this isn't true, 
please explain what's

included in the "Reports" tab.

(T) Pg. 178 "node with errors and warning" ->
"node with errors and warnings"

(U) Pg. 179 What's an "eventful node"?

(E) Pg. 179 "query for all of the nodes" ->
"query all of the nodes running Debian Linux"

(T) Pg. 180 "which like Foreman" ->
"which, like Foreman"

(T) Pg. 180 "advancing reporting tools" ->
"advanced reporting tools"

(E) Pg. 180 "enterprise product line and support" ->
"enterprise product line"

(U) Pg. 180 "One of the key differences from Foreman is that PE Console 
focuses on Puppet and its related products" ->

Foreman focuses on Puppet also. How is this different than PE Console?

(T) Pg. 180 "For this section will be running" ->
"For this section we will be running"

(T) Pg. 180 "access the console" ->
"access the PE console"

(T) Pg. 181 "Once our nodes have checked in, we can begin applying 
configuration to them" ->
"Once your nodes have checked in, you can begin applying configuration 
to them"

(Why did you change person here? This problem also exists on Pg. 182)

(T) Pg. 183 "Once your click Run" ->
"Once you click Run"

(T) Pg. 184 "requests HTTP library" ->
"Requests HTTP library"

(E) Pg. 184 "Every node that runs" ->
"Every running node"

(U) Pg. 184 "If the capability is enabled, it can also give you"
The pronoun reference for "it" isn't clear. Is it referring to PuppetDB
or the capability, or Puppetboard?

(E) Pg. 185 "you will have to run Puppetboard" ->
"you will have to install Puppetboard"

(E) Pg. 185 "another httpd, like Nginx" ->
"another web server, like Nginx"

(E) Pg. 185 "nodes who changed" ->
"nodes that changed"

(E) Pg. 186 "filter the table for you" ->
"filter the table"

(E) Pg. 186 "it will give you" ->
"you'll have"

(E) Pg. 187 "showing for which nodes this fact is known " ->
"showing which nodes have this fact"

(E) Pg. 188 "and allows you" ->
"and allowing you"

(E) Pg. 188 "as we try" ->
"as it tries"

(C) Pg. 189 "that enable you to provide graphing to your team"
I looked all through this chapter and I didn't see anything about
graphing. What did I miss?

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/531FD2C5.3050903%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Cleaning up temp files with puppet

2014-03-11 Thread Johan De Wit

On 11/03/14 23:09, nfwlpw wrote:
So I have a puppet module, that gets a script from files/, runs that 
script, and after it's done, I'd like to remove it.


Unfortunately puppet doesn't seem to like to have 2 different File 
resource aliased to the same, so I can't do


file { "myfile":
ensure => present,
source => "puppet:///...",
}

file { "remove myfile":
path => "myfile",
   ensure => absent,
}

Puppet gave the error: err: Failed to apply catalog: Cannot alias 
File[remove myfile]...myfile already declared...


The only work around I've found is using an exec resource. Anyone know 
how to do this without exec?


Thank you



Thats the nature of puppet.

It describes the 'state' of your node.  So the file cannot be present 
and absent at the same time.



you could use an exec that wget/curl/... your tempfile, execute it, and 
remove it, and using a creates =>  to 
run it only when needed.


depends on what you exactly wants to achieve.











--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer (805008667232363)
Puppet Certified Professional 2013 (PCP006)
_
 
Open-Future Phone +32 (0)2/255 70 70

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


Next Events:
Zabbix Certified Training | 
http://www.open-future.be/zabbix-certified-training-10-till-12th-march
Zabbix for Large Environments Training | 
http://www.open-future.be/zabbix-large-environments-training-13-till-14th-march
Puppet Intruction Course | 
http://www.open-future.be/puppet-introduction-course-14th-april
Puppet Advanced Training | 
http://www.open-future.be/puppet-advanced-training-15-till-17th-april
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/531F8FF6.605%40open-future.be.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Cleaning up temp files with puppet

2014-03-11 Thread nfwlpw
So I have a puppet module, that gets a script from files/, runs that 
script, and after it's done, I'd like to remove it.

Unfortunately puppet doesn't seem to like to have 2 different File resource 
aliased to the same, so I can't do

file { "myfile": 
ensure => present,
source => "puppet:///...",
}

file { "remove myfile":
path => "myfile",
   ensure => absent,
}

Puppet gave the error: err: Failed to apply catalog: Cannot alias 
File[remove myfile]...myfile already declared...

The only work around I've found is using an exec resource.  Anyone know how 
to do this without exec?

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d503ce3f-7678-4056-8386-b7eaaa02eb66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Dashboard not working (406 Not Acceptable)

2014-03-11 Thread Chad Matsalla
I have this directory and it's writable. I'm still getting a 406. Was there 
anything else I could try? I'm not even sure the relevant parts of 
configuration to show. Let's see:
- I got the same error whether I was using the rails built-in server and 
now when I'm using apache/passenger
- reports = puppet_dashboard, store, http (fail)
- reports = store, http (fail)

Anyone?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/fb59abbe-8c41-45b6-9648-e2d24f8a76f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Pushing git repo to Windows agent

2014-03-11 Thread Nick Miller
Steps to reproduce:

1) Create a new git repository (I'm using Bitbucket)

2) Create a file called 'test1.txt', and push it to the repo.

3) Create a class to pull the repo.  I'm using ssh cert authentication, but 
I'm not sure that matters

class gitrepo {

 vcsrepo { '/tmp/git/puppet-test':


ensure  => latest,

provider=> git,

source  => "g...@bitbucket.org:user/puppet-test.git",

revision=> 'master',

}



}


4) Run 'puppet agent --test' to pull the repo down

5) Add another file to the repo, say 'test2.txt' and push the changes to git

6) Run 'puppet agent --test' again to pull the latest changes.

Any changes to existing files don't seem to cause the problem, only new 
files.



On Tuesday, March 11, 2014 10:25:54 AM UTC-4, jcbollinger wrote:
>
>
>
> On Monday, March 10, 2014 9:46:21 AM UTC-5, Nick Miller wrote:
>>
>> Thank you for the replies.  What I've done is setup the agent on the 
>> puppet master to pull the latest version of the repo, then the agents 
>> recursively pull the directory.  There are a couple of problems I'm running 
>> into.  
>>
>> The first is that line breaks seem to be stripped from any text files the 
>> nodes pull down.  On the master the file looks correct, but then on the 
>> node all of the line breaks are gone.
>>
>
>
> Most likely the files have UNIX line endings (LF instead of CRLF).  If you 
> turn on the git option "core.autocrlf" for the repo on your clients, then 
> git should convert convert line termination of text files automatically.
>
>  
>
>>
>> I occasionally run into the following error when pulling the latest 
>> version of the repo:
>>
>> Error: /Stage[main]/Gitrepo/Vcsrepo[/tmp/git/puppet-test]: Could not 
>> evaluate: Execution of '/bin/git rev-parse origin/(detached from 3c40894)' 
>> returned 128: fatal: ambiguous argument 'origin/(detached from 3c40894)': 
>> unknown revision or path not in the working tree.
>> Use '--' to separate paths from revisions, like this:
>> 'git  [...] -- [...]'
>> origin/(detached from 3c40894)
>>
>>
>
> I am not enough of a git illuminatus to immediately know what that means.  
> I find the appearance of the literal string '(detached from 3c40894)' 
> suspicious, however.  My guess is that you are somehow creating a situation 
> that vcsrepo does not handle appropriately.
>
>  
>
>> It seems to happen when I add a file to the repo.  In the manifest I have 
>> the following:
>>
>> class gitrepo {
>>  vcsrepo { '/tmp/git/puppet-test':
>>
>> ensure  => latest,
>> provider=> git,
>> source  => 
>> "g...@bitbucket.org:user/puppet-test.git",
>> revision=> 'master',
>> }
>>
>>
>> }
>>
>
>
> Supposing that none of the git experts around here jumps in with special 
> insight on your problem, it would be helpful to identify exactly what steps 
> are required to elicit the error.
>
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6b642940-18ba-4e2e-80e4-060bbf46a66b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] ENC broken in the strangest way.

2014-03-11 Thread José Luis Ledesma
El 11/03/2014 20:47, "Steve Neuharth"  escribió:
>
> I have an ENC that's set up like this:
>
> [master]
>   masterport = 8140
>   bindaddress = 0.0.0.0
>   ssl_client_header = SSL_CLIENT_S_DN
>   ssl_client_verify_header = SSL_CLIENT_VERIFY
>   autosign = true
>   storeconfigs = true
>
>   environment = production
>   manifest= $confdir/environments/$environment/manifests/site.pp
>   modulepath  = $confdir/environments/$environment/modules
>
>
>   # Sets PuppetDB database backend
>   storeconfigs_backend = puppetdb
>
>   # Reporting
>   reports = log
>   reporturl = http://localhost:3000/reports
>
>   # Local Inventory Service
>   facts_terminus = active_record
>
>   # Activate external node classifier
>   external_nodes = $confdir/environments/$environment/node.rb
>   node_terminus = exec
>
>
> when I run puppet agent on my test box, I get this:
>
> [root@stevetest3 ~]# puppet agent --test --environment=dev
> Warning: Unable to fetch my node definition, but the agent run will
continue:
> Warning: Error 400 on SERVER: Failed to find stevetest3.gblmktgaws.comvia 
> exec: Execution of '/etc/puppet/environments/production/node.rb
stevetest3.gblmktgaws.com' returned 1:
>
> so, jumping back to the puppet server I try the ENC and I get this:
>
> [root@puppet puppet]# /etc/puppet/environments/production/node.rb
stevetest3.gblmktgaws.com
> ---
> environment:
> classes:
> parameters:
>   role: webserver
>   ec2_tag_Name: stevetest3
>   env: dev
>   client: foo
>
> [root@puppet puppet]# echo $?
> 0
>
> so:
>
> 1) why is it running the node classifier from the production environment
instead dev like I asked

Not sure, but have you tried to remove the environment=production from the
master section? If its about the puppet master itself it should be in the
agent section.

> 2) why can't puppetmaster or passenger run the damn script?

Have you tried to run it with the puppet master user ( usually puppet) it
could be some kind of permissions problem.
>
> I'm totally stuck, any help would be greatly appreciated.
>
> --steve
>
>
> --
> 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 view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/d88e2c6c-75ba-42e8-a043-4ad576ef5ef6%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAF_B3ddAxuCqPzbq3YJWn3D_MT7aXt-SxpH%3DycKX2pY9ZVVOpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] ENC broken in the strangest way.

2014-03-11 Thread Steve Neuharth
I have an ENC that's set up like this:

[master]
  masterport = 8140
  bindaddress = 0.0.0.0
  ssl_client_header = SSL_CLIENT_S_DN
  ssl_client_verify_header = SSL_CLIENT_VERIFY
  autosign = true
  storeconfigs = true



*  environment = production  manifest= 
$confdir/environments/$environment/manifests/site.pp  modulepath  = 
$confdir/environments/$environment/modules*


  # Sets PuppetDB database backend
  storeconfigs_backend = puppetdb

  # Reporting
  reports = log
  reporturl = http://localhost:3000/reports

  # Local Inventory Service
  facts_terminus = active_record

  # Activate external node classifier

*  external_nodes = $confdir/environments/$environment/node.rb  
node_terminus = exec*


when I run puppet agent on my test box, I get this:

[root@stevetest3 ~]# puppet agent --test --environment=*dev*
Warning: Unable to fetch my node definition, but the agent run will 
continue:
Warning: Error 400 on SERVER: Failed to find stevetest3.gblmktgaws.com via 
exec: Execution of '/etc/puppet/environments/*production*/node.rb 
stevetest3.gblmktgaws.com' returned 1: 

so, jumping back to the puppet server I try the ENC and I get this:

[root@puppet puppet]# /etc/puppet/environments/production/node.rb 
stevetest3.gblmktgaws.com
--- 
environment: 
classes: 
parameters: 
  role: webserver
  ec2_tag_Name: stevetest3
  env: dev
  client: foo

[root@puppet puppet]# echo $?
*0*

so:

1) why is it running the node classifier from the production environment 
instead dev like I asked
2) why can't puppetmaster or passenger run the damn script?

I'm totally stuck, any help would be greatly appreciated.

--steve


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d88e2c6c-75ba-42e8-a043-4ad576ef5ef6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Problem with custom facts and hiera

2014-03-11 Thread Matthew Burgess
On 11 Mar 2014 10:21, "Dirk Heinrichs"  wrote:
>
> To me it looks like facter is reading the file containing the custom
fact, while the agent does not.

Puppet uses /etc/puppet/hiera.yaml (or /etc/puppetlabs/puppet/hiera.yaml
for PE) not /etc/hiera.yaml. You could symlink them so that the hiera
command and puppet both use the same configuration.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAKUTv3KQc5oA_g4a8sw6%3DV3qZ_ArLB9rcjVoKTuUfMHcW6NrDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: how do I check to see whether a hash value is defined if a parent of the hash value might not even exist?

2014-03-11 Thread Steve Neuharth
very interesting. Maybe I need to just bite the bullet and use hiera.

On Tuesday, March 11, 2014 11:00:46 AM UTC-5, David Schmitt wrote:
>
> What about using hiera: 
>
> data.yaml: 
> --- 
> client::dev::sw::server_name: ws.foo.bar 
>
> pp: 
> $server_name = 
> hiera("client::${::client}::${::env}::${name}::server_name", "default 
> value") 
>
> Regards, David 
>
> On 2014-03-11 16:34, Steve Neuharth wrote: 
> > this works: 
> > 
> >  # set up our servername 
> >  if $web_conf[$::client] { 
> >  if $web_conf[$::client][$::env] { 
> >  if $web_conf[$::client][$::env][$name] { 
> >  if $web_conf[$::client][$::env][$name]['server_name'] { 
> >  $server_name = $web_conf[$::client][$::env][$name]['server_name'] 
> >  } else { 
> >  $server_name = "${name}.${client_code}.${::env}.${domain}" 
> >  } 
> >  } else { 
> >  $server_name = "${name}.${client_code}.${::env}.${domain}" 
> >  } 
> >  } else { 
> >  $server_name = "${name}.${client_code}.${::env}.${domain}" 
> >  } 
> >  } else { 
> >  $server_name = "${name}.${client_code}.${::env}.${domain}" 
> >  } 
> > 
> > but it's SO UGLY. Any recommendations on making it prettier? 
> > 
> > On Monday, March 10, 2014 3:42:36 PM UTC-5, Steve Neuharth wrote: 
> > 
> >> I've got a big hash of info that looks like this: 
> >> 
> >> $web_conf = { 
> >> my_client => { 
> >> dev => { 
> >> ws => { 
> >> server_name => 'ws.foo.bar', 
> >> server_aliases => ['ws.dev.bar.foo.com [1]', 
> >> 'ws.dev.another.foo.com [2]'], 
> >> }, 
> >> csr => { 
> >> server_aliases => ['csr.dev.bar.foo.com [3]', 
> >> 'csr.dev.another.foo.com [4]'], 
> >> }, 
> >> mw => { 
> >> server_aliases => ['mw.dev.bar.foo.com [5]', 
> >> 'mw.dev.another.foo.com [6]'], 
> >> }, 
> >> }, 
> >> } 
> >> 
> >> I'm trying to do something like this in my manifest: 
> >> 
> >> # set up our servername 
> >> if $web_conf[$::client][$::env][$name]['server_name'] { 
> >> $server_name = $web_conf[$::client][$::env][$name]['server_name'] 
> >> } else { 
> >> $server_name = "${name}.${client_code}.${::env}.${domain}" 
> >> } 
> >> 
> >> The thought was that I'd have servers that follow a certain naming 
> >> convention and ones that don't. The ones that have 'special' names 
> >> go in the web_conf hash. If the manifest 'sees' a server name in the 
> >> hash, it should use that. If not, then it just does the 'else' bit. 
> >> 
> >> The trouble is that it totally fails if even the top or intermediate 
> >> levels of the hash don't exist. I've tried using "if 
> >> $web_conf[$::client][$::env][$name]['server_name'] != undef", tried 
> >> "if undef($web_conf[$::client][$::env][$name]['server_name'])" etc. 
> >> 
> >> what's the correct way to do this? 
> >> --steve 
> > 
> >  -- 
> >  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  [7]. 
> >  To view this discussion on the web visit 
> > 
> > 
> https://groups.google.com/d/msgid/puppet-users/3355ea2c-0aae-436b-9098-d98a7de54dfb%40googlegroups.com
>  
> > [8]. 
> >  For more options, visit https://groups.google.com/d/optout [9]. 
> > 
> > 
> > Links: 
> > -- 
> > [1] 
> > 
> > 
> http://www.google.com/url?q75http%3A%2F%2Fws.dev.bar.foo.com46sa75D46sntz�75146usg75AFQjCNFmX6cyyTaccoxrdubRxxpiElZdiA
>  
>
> > [2] 
> > 
> > 
> http://www.google.com/url?q75http%3A%2F%2Fws.dev.another.foo.com46sa75D46sntz�75146usg75AFQjCNH3NlITRPS_yRUnnGBU5opR17P7qw
>  
>
> > [3] 
> > 
> > 
> http://www.google.com/url?q75http%3A%2F%2Fcsr.dev.bar.foo.com46sa75D46sntz�75146usg75AFQjCNFFDzU4C1eUsUjzElCeOoQ3wAfpDw
>  
>
> > [4] 
> > 
> > 
> http://www.google.com/url?q75http%3A%2F%2Fcsr.dev.another.foo.com46sa75D46sntz�75146usg75AFQjCNGdGhCjs7JRYmkLXmT3Z194V2MkBw
>  
>
> > [5] 
> > 
> > 
> http://www.google.com/url?q75http%3A%2F%2Fmw.dev.bar.foo.com46sa75D46sntz�75146usg75AFQjCNHrYg2mzHmEkTedOjOqvRgIOOiEdA
>  
>
> > [6] 
> > 
> > 
> http://www.google.com/url?q75http%3A%2F%2Fmw.dev.another.foo.com46sa75D46sntz�75146usg75AFQjCNF0vYQdfXCDOt2znwABX_D1peMUvw
>  
>
> > [7] mailto:puppet-users+unsubscr...@googlegroups.com  
> > [8] 
> > 
> > 
> https://groups.google.com/d/msgid/puppet-users/3355ea2c-0aae-436b-9098-d98a7de54dfb%40googlegroups.com?utm_medium=email&utm_source=footer
>  
> > [9] https://groups.google.com/d/optout 
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d9c3d4fa-36e5-47b8-9b1a-7b7e108ae4d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] my puppets clients are unreachable

2014-03-11 Thread David Schmitt

On 2014-03-11 17:35, puppetstan wrote:

Hello

After to change a network device beetween my puppetmaster and my puppets
clients my puppetmaster, my puppets clients are unreachable.

I changed a network device in front of a zone server. I need to edit the
file / etc / resolv.conf for all servers behind this network with my
puppetmaster but my puppets clients are unreachable, The
puppet-dasboardsay : Unresponsive.

I m obliged to go to each server and restart puppet client service on
each server so that it works again

Is there another solution because i have a lot of puppets clients?


You might have luck if you restore DNS service on the "old" address 
until all nodes have received the updated resolve.conf.



Good luck, D.

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/531F6282.3020804%40dasz.at.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stdlib: result from join_keys_to_values() is unstable

2014-03-11 Thread Gabriel Filion
On 11/03/14 12:58 PM, Matthaus Owens wrote:
> I don't know about the specific implementation of join_keys_to_values,
> but ruby's hash behavior changed between the 1.8 series and 1.9 and
> later[1]. In ruby 1.8 hashes are enumerated in a seemingly unsorted
> manner, while in ruby 1.9 and later hashes are enumerated in insertion
> order. If you are on ruby 1.8, it would be worth seeing if you
> experience the same issues in ruby 1.9 or later.
> 
> [1] - 
> http://stackoverflow.com/questions/7065915/why-is-my-hash-autosorting-itself

oh, well that's interesting.

thanks for the feedback, I'll se about using ruby 1.9.x

> On Tue, Mar 11, 2014 at 9:27 AM, Gabriel Filion  wrote:
>> Hi there,
>>
>> Say I have a hash like {a=>'1',b=>'2'} and I'd like to get a string that
>> looks like "a=1,b=2". I tried using a combination of
>> join_keys_to_values() and join() and the result looked correct, but was
>> unstable. That unstability is because hashes are not always "sorted" the
>> same way.
>>
>> An unstable string means that the config file in which I use it gets
>> modified for no reason from time to time and this triggers an
>> unnecessary service refresh.
>>
>> I'm currently using an inline template to achieve what I want, since
>> with ruby I can use h.sort.map to always get results in the same order
>> from a hash "h".
>>
>> Thing is, stdlib's sort() function only accepts strings or arrays.
>>
>>
>> Is there a way to get a "stable" string with current means?
>>
>> Otherwise, would it be an acceptable idea to add support for hashes in
>> sort() ?

-- 
Gabriel Filion



signature.asc
Description: OpenPGP digital signature


Re: [Puppet Users] Re: Problems in Ch. 4 of Pro Puppet 2nd Edition

2014-03-11 Thread Jon Forrest
On 3/11/2014 10:32 AM, Spencer Krum wrote:
> Thanks so much for reading attentively and posting your feedback. I'm
> sorry you don't want to help us more formally.

I want to make it clear that the reason for this is because since
this is a closed-source book, I'd need some form of payment for
a formal relationship (I've done massive free edits of Pro Git and
Managing Jenkins because these are open-source books). At this point,
such things only complicate my taxes and make me feel obligated to
get things done to meet deadlines. Since I have a fulltime day job
I can't commit to anything with fixed deadlines. It wouldn't be fair
to you or Apress.

> I don't think its realistic to open source the book at this point, but I'll 
> open the
> conversation with Apress and the other authors.

OK. If you do change your mind then I'd be more than glad to work with
you.

Jon

On Tue, Mar 11, 2014 at 10:32 AM, Spencer Krum  wrote:
>
> Hi Jon,
>
> I'll ask my editor to link the errata from the github repository to the
> eratta page on the Apress website. I want to assure you we went through
> several rounds of editing, but errors are always going to fall through.
> Thanks so much for reading attentively and posting your feedback. I'm sorry
> you don't want to help us more formally. I don't think its realistic to open
> source the book at this point, but I'll open the conversation with Apress
> and the other authors.
>
> Thanks again,
> Spencer
>
> On Monday, March 10, 2014 4:31:26 AM UTC, Jon Forrest wrote:
>>
>>
>>
>> On Wednesday, March 5, 2014 10:29:07 AM UTC-8, Spencer Krum wrote:
>> Hi Jon,
>>
>> > My name is Spencer Krum. I am one of the authors of Pro Puppet. I want
>> > to thank you for going through the book with such a fine toothed comb.
>> > I wish I had known you were so committed to making this book a success
>> > months ago. I would have gotten you an advance copy so you could
>> > have helped make the final version better.
>>
>> What concerns me most is how Apress could have released a book with so
>> many issues.
>> Somehow their production process broke down.
>>
>> > From what I understand from Apress, we don't have the ability to
>> > directly address these problems in newly sold versions of the book.
>> > These errors will be with us until a 3rd edition comes out, maybe
>> > sometime around Puppet 4.
>>
>> I'm sorry to hear that. That seems like a long time to wait. What's worse
>> is that people who don't read this email list
>> will have no idea that this book is full of issues. Even now, after I've
>> been releasing these lists for ~2 weeks, the
>> errata page on the Apress web site (http://www.apress.com/9781430260400)
>> still says there are no errata for this book.
>> That's not fair.
>>
>> > Here is what we can do. I have created a github repository to collect
>> > the errata in a single place.
>> > https://github.com/pro-puppet/pro-puppet-errata
>> > I don't think we can get that link added to the front matter, but we can
>> > probably get it added to the description of
>> > the book on Amazon, and can link to it in the online/supplemental
>> > materials. This repository is one central place
>> > we can collect all the errors/corrections about Pro Puppet 2n'd edition,
>> > not just yours.
>> > I've already added your ch1-4 reviews to that project. Would you be
>> > willing to work on the rest of the chapters with us?
>>
>> Since I haven't received any money from Apress, nor will I request
>> anything other than my own copy of the book (which
>> they've now given me), I'm not inclined to formally work on this project
>> (see below)
>>
>> > If you feel comfortable with git/github I can give you contributor
>> > access or I can add the text if you want to send it to me.
>> > I think collecting all the errors in the github repository is a better
>> > solution than posting them all to separate messages
>> > to the Puppet users mailing list, a list of over a thousand people.
>> > What do you think?
>>
>> What I'm planning on doing is continuing on as I have been. I'm going to
>> post my lists, chapter
>> by chapter, to this list. You, and anybody else, are free to do whatever
>> you want with them, such as putting
>> them up on GitHub. I clearly label these postings so anyone who isn't
>> interested in them can easily
>> skip them.
>>
>> Is this a reasonable approach?
>>
>> Jon Forrest
>>
>> P.S. Have you considered putting the sources for Pro Puppet 2nd ed. up on
>> GitHub the way
>> Scott Chacon did for Pro Git?
>
> --
> 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/dzXe29iNwtQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/52ee6a2c-8cbd-4d2d-a687-4a5cee33aa6a%40googlegroups.com

[Puppet Users] Re: Problems in Ch. 4 of Pro Puppet 2nd Edition

2014-03-11 Thread Spencer Krum

Hi Jon, 

I'll ask my editor to link the errata from the github repository to the 
eratta page on the Apress website. I want to assure you we went through 
several rounds of editing, but errors are always going to fall through. 
Thanks so much for reading attentively and posting your feedback. I'm sorry 
you don't want to help us more formally. I don't think its realistic to 
open source the book at this point, but I'll open the conversation with 
Apress and the other authors.

Thanks again,
Spencer

On Monday, March 10, 2014 4:31:26 AM UTC, Jon Forrest wrote:
>
>
>
> On Wednesday, March 5, 2014 10:29:07 AM UTC-8, Spencer Krum wrote:
> Hi Jon,
>
> > My name is Spencer Krum. I am one of the authors of Pro Puppet. I want 
> to thank you for going through the book with such a fine toothed comb.
> > I wish I had known you were so committed to making this book a success 
> months ago. I would have gotten you an advance copy so you could
> > have helped make the final version better.
>
> What concerns me most is how Apress could have released a book with so 
> many issues.
> Somehow their production process broke down. 
>
> > From what I understand from Apress, we don't have the ability to 
> directly address these problems in newly sold versions of the book.
> > These errors will be with us until a 3rd edition comes out, maybe 
> sometime around Puppet 4.
>
> I'm sorry to hear that. That seems like a long time to wait. What's worse 
> is that people who don't read this email list
> will have no idea that this book is full of issues. Even now, after I've 
> been releasing these lists for ~2 weeks, the
> errata page on the Apress web site (http://www.apress.com/9781430260400) 
> still says there are no errata for this book.
> That's not fair.
>
> > Here is what we can do. I have created a github repository to collect 
> the errata in a single place.
> > https://github.com/pro-puppet/pro-puppet-errata
> > I don't think we can get that link added to the front matter, but we can 
> probably get it added to the description of
> > the book on Amazon, and can link to it in the online/supplemental 
> materials. This repository is one central place
> > we can collect all the errors/corrections about Pro Puppet 2n'd edition, 
> not just yours.
> > I've already added your ch1-4 reviews to that project. Would you be 
> willing to work on the rest of the chapters with us?
>
> Since I haven't received any money from Apress, nor will I request 
> anything other than my own copy of the book (which
> they've now given me), I'm not inclined to formally work on this project 
> (see below)
>
> > If you feel comfortable with git/github I can give you contributor 
> access or I can add the text if you want to send it to me.
> > I think collecting all the errors in the github repository is a better 
> solution than posting them all to separate messages
> > to the Puppet users mailing list, a list of over a thousand people.
> > What do you think?
>
> What I'm planning on doing is continuing on as I have been. I'm going to 
> post my lists, chapter
> by chapter, to this list. You, and anybody else, are free to do whatever 
> you want with them, such as putting
> them up on GitHub. I clearly label these postings so anyone who isn't 
> interested in them can easily
> skip them.
>
> Is this a reasonable approach?
>
> Jon Forrest
>
> P.S. Have you considered putting the sources for Pro Puppet 2nd ed. up on 
> GitHub the way
> Scott Chacon did for Pro Git?
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/52ee6a2c-8cbd-4d2d-a687-4a5cee33aa6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetdb question !!!

2014-03-11 Thread Ken Barber
> Just a suggestion .. it will really good if you can add field "date added"
> to the certname table just reporting purposes.

Feel free to raise that as a feature request here Rakesh:
https://tickets.puppetlabs.com/browse/PDB

ken.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAE4bNT%3D6LBjFCDrym8auMw7ufxMwBmV_d6x-yTO4CxdMPkdKqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stdlib: result from join_keys_to_values() is unstable

2014-03-11 Thread Matthaus Owens
Gabriel,
I don't know about the specific implementation of join_keys_to_values,
but ruby's hash behavior changed between the 1.8 series and 1.9 and
later[1]. In ruby 1.8 hashes are enumerated in a seemingly unsorted
manner, while in ruby 1.9 and later hashes are enumerated in insertion
order. If you are on ruby 1.8, it would be worth seeing if you
experience the same issues in ruby 1.9 or later.

[1] - 
http://stackoverflow.com/questions/7065915/why-is-my-hash-autosorting-itself

On Tue, Mar 11, 2014 at 9:27 AM, Gabriel Filion  wrote:
> Hi there,
>
> Say I have a hash like {a=>'1',b=>'2'} and I'd like to get a string that
> looks like "a=1,b=2". I tried using a combination of
> join_keys_to_values() and join() and the result looked correct, but was
> unstable. That unstability is because hashes are not always "sorted" the
> same way.
>
> An unstable string means that the config file in which I use it gets
> modified for no reason from time to time and this triggers an
> unnecessary service refresh.
>
> I'm currently using an inline template to achieve what I want, since
> with ruby I can use h.sort.map to always get results in the same order
> from a hash "h".
>
> Thing is, stdlib's sort() function only accepts strings or arrays.
>
>
> Is there a way to get a "stable" string with current means?
>
> Otherwise, would it be an acceptable idea to add support for hashes in
> sort() ?
>
> --
> Gabriel Filion
>



-- 
Matthaus Owens
Release Manager, Puppet Labs

Join us at PuppetConf 2014, September 23-24 in San Francisco -
http://bit.ly/pupconf14
Register now and save $350!

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACD%3DwAeMtS1XMAaub9u5nWhhZMEcaFXPX6K%3DAmt_UZmhrOmhyw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] my puppets clients are unreachable

2014-03-11 Thread puppetstan
Hello 

After to change a network device beetween my puppetmaster and my puppets 
clients my puppetmaster, my puppets clients are unreachable.

I changed a network device in front of a zone server. I need to edit the 
file / etc / resolv.conf for all servers behind this network with my 
puppetmaster but my puppets clients are unreachable, The puppet-dasboardsay : 
Unresponsive. 

I m obliged to go to each server and restart puppet client service on each 
server so that it works again 

Is there another solution because i have a lot of puppets clients? 

thank you 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/03377948-73d6-4f45-b882-8019ff19f9dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Meeting Puppet contractors

2014-03-11 Thread Brandon Clark
I'm not clear on what the etiquette is here but I was hoping to reach out 
to the puppet community to see if there are any sysops people here who are 
looking for work. My current admin recently got a new job and moved on so I 
have need of a replacement person with puppet experience. If these kinds of 
posts are not welcome I understand if it needs to be moderated. Perhaps I 
can get a recommendation of where I can meet potential contractors? 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/4f6c2f7a-0e74-4196-9cfa-374f0a38d6fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] stdlib: result from join_keys_to_values() is unstable

2014-03-11 Thread Gabriel Filion
Hi there,

Say I have a hash like {a=>'1',b=>'2'} and I'd like to get a string that
looks like "a=1,b=2". I tried using a combination of
join_keys_to_values() and join() and the result looked correct, but was
unstable. That unstability is because hashes are not always "sorted" the
same way.

An unstable string means that the config file in which I use it gets
modified for no reason from time to time and this triggers an
unnecessary service refresh.

I'm currently using an inline template to achieve what I want, since
with ruby I can use h.sort.map to always get results in the same order
from a hash "h".

Thing is, stdlib's sort() function only accepts strings or arrays.


Is there a way to get a "stable" string with current means?

Otherwise, would it be an acceptable idea to add support for hashes in
sort() ?

-- 
Gabriel Filion



signature.asc
Description: OpenPGP digital signature


Re: [Puppet Users] Re: Remove certificate requests

2014-03-11 Thread robert . buchholz
On Friday, December 21, 2012 9:59:49 PM UTC+1, Calvin Walton wrote:
>
> On Fri, 2012-12-14 at 21:14 +, Tim Bishop wrote: 
> > Nope: 
> > 
> > puppetmaster# puppet cert list 
> >   "fb311ff01c6f0130b650005056bc6664" (SHA256) 
> FB:E2:F1:86:5D:80:74:25:35:75:3D:09:8F:1E:41:0B:15:D2:66:01:F2:F1:B3:4E:6D:5B:F9:85:4B:BC:AC:28
>  
>
> > 
> > puppetmaster# puppet cert clean fb311ff01c6f0130b650005056bc6664 
> > Error: Could not find a serial number for 
> fb311ff01c6f0130b650005056bc6664 
> > 
> > Looks like it only cleans signed certificates, not requests. 
>
> I think this is actually a bug, has any one reported it on the issue 
> tracking system yet? 
>
> 'puppet cert clean' used to work to clean unsigned certificates in 
> puppet 2.7, but no longer does in 3.0 
>

I could not find any issue yet, so I have created 
https://tickets.puppetlabs.com/browse/PUP-1916 


Cheers,

Robert

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8f7d4138-d157-46e1-b557-0f82d8cb8678%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: how do I check to see whether a hash value is defined if a parent of the hash value might not even exist?

2014-03-11 Thread David Schmitt

What about using hiera:

data.yaml:
---
client::dev::sw::server_name: ws.foo.bar

pp:
$server_name = 
hiera("client::${::client}::${::env}::${name}::server_name", "default 
value")


Regards, David

On 2014-03-11 16:34, Steve Neuharth wrote:

this works:

 # set up our servername
 if $web_conf[$::client] {
 if $web_conf[$::client][$::env] {
 if $web_conf[$::client][$::env][$name] {
 if $web_conf[$::client][$::env][$name]['server_name'] {
 $server_name = $web_conf[$::client][$::env][$name]['server_name']
 } else {
 $server_name = "${name}.${client_code}.${::env}.${domain}"
 }
 } else {
 $server_name = "${name}.${client_code}.${::env}.${domain}"
 }
 } else {
 $server_name = "${name}.${client_code}.${::env}.${domain}"
 }
 } else {
 $server_name = "${name}.${client_code}.${::env}.${domain}"
 }

but it's SO UGLY. Any recommendations on making it prettier?

On Monday, March 10, 2014 3:42:36 PM UTC-5, Steve Neuharth wrote:


I've got a big hash of info that looks like this:

$web_conf = {
my_client => {
dev => {
ws => {
server_name => 'ws.foo.bar',
server_aliases => ['ws.dev.bar.foo.com [1]',
'ws.dev.another.foo.com [2]'],
},
csr => {
server_aliases => ['csr.dev.bar.foo.com [3]',
'csr.dev.another.foo.com [4]'],
},
mw => {
server_aliases => ['mw.dev.bar.foo.com [5]',
'mw.dev.another.foo.com [6]'],
},
},
}

I'm trying to do something like this in my manifest:

# set up our servername
if $web_conf[$::client][$::env][$name]['server_name'] {
$server_name = $web_conf[$::client][$::env][$name]['server_name']
} else {
$server_name = "${name}.${client_code}.${::env}.${domain}"
}

The thought was that I'd have servers that follow a certain naming
convention and ones that don't. The ones that have 'special' names
go in the web_conf hash. If the manifest 'sees' a server name in the
hash, it should use that. If not, then it just does the 'else' bit.

The trouble is that it totally fails if even the top or intermediate
levels of the hash don't exist. I've tried using "if
$web_conf[$::client][$::env][$name]['server_name'] != undef", tried
"if undef($web_conf[$::client][$::env][$name]['server_name'])" etc.

what's the correct way to do this?
--steve


 --
 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 [7].
 To view this discussion on the web visit

https://groups.google.com/d/msgid/puppet-users/3355ea2c-0aae-436b-9098-d98a7de54dfb%40googlegroups.com
[8].
 For more options, visit https://groups.google.com/d/optout [9].


Links:
--
[1]

http://www.google.com/url?q75http%3A%2F%2Fws.dev.bar.foo.com46sa75D46sntz�75146usg75AFQjCNFmX6cyyTaccoxrdubRxxpiElZdiA
[2]

http://www.google.com/url?q75http%3A%2F%2Fws.dev.another.foo.com46sa75D46sntz�75146usg75AFQjCNH3NlITRPS_yRUnnGBU5opR17P7qw
[3]

http://www.google.com/url?q75http%3A%2F%2Fcsr.dev.bar.foo.com46sa75D46sntz�75146usg75AFQjCNFFDzU4C1eUsUjzElCeOoQ3wAfpDw
[4]

http://www.google.com/url?q75http%3A%2F%2Fcsr.dev.another.foo.com46sa75D46sntz�75146usg75AFQjCNGdGhCjs7JRYmkLXmT3Z194V2MkBw
[5]

http://www.google.com/url?q75http%3A%2F%2Fmw.dev.bar.foo.com46sa75D46sntz�75146usg75AFQjCNHrYg2mzHmEkTedOjOqvRgIOOiEdA
[6]

http://www.google.com/url?q75http%3A%2F%2Fmw.dev.another.foo.com46sa75D46sntz�75146usg75AFQjCNF0vYQdfXCDOt2znwABX_D1peMUvw
[7] mailto:puppet-users+unsubscr...@googlegroups.com
[8]

https://groups.google.com/d/msgid/puppet-users/3355ea2c-0aae-436b-9098-d98a7de54dfb%40googlegroups.com?utm_medium=email&utm_source=footer
[9] https://groups.google.com/d/optout


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/759cb2179d3f573ef0478181a6fe914b%40hosting.edv-bus.at.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how do I check to see whether a hash value is defined if a parent of the hash value might not even exist?

2014-03-11 Thread Steve Neuharth
this works:

  # set up our servername
  if $web_conf[$::client] {
if $web_conf[$::client][$::env] {
  if $web_conf[$::client][$::env][$name] {
if $web_conf[$::client][$::env][$name]['server_name'] {
  $server_name = $web_conf[$::client][$::env][$name]['server_name']
} else {
  $server_name = "${name}.${client_code}.${::env}.${domain}"
}
  } else {
$server_name = "${name}.${client_code}.${::env}.${domain}"
  }
} else {
  $server_name = "${name}.${client_code}.${::env}.${domain}"
}
  } else {
$server_name = "${name}.${client_code}.${::env}.${domain}"
  }

but it's SO UGLY. Any recommendations on making it prettier?

On Monday, March 10, 2014 3:42:36 PM UTC-5, Steve Neuharth wrote:
>
> I've got a big hash of info that looks like this:
>
>   $web_conf = {
> my_client => {
>   dev => { 
> ws => {
>   server_name => 'ws.foo.bar',
>   server_aliases => ['ws.dev.bar.foo.com', 'ws.dev.another.foo.com'], 
>
> },
> csr => { 
>   server_aliases => ['csr.dev.bar.foo.com', '
> csr.dev.another.foo.com'], 
> },
> mw => { 
>   server_aliases => ['mw.dev.bar.foo.com', 'mw.dev.another.foo.com'], 
>
> },
>   },
> }
>
> I'm trying to do something like this in my manifest:
>
>   # set up our servername
>   if $web_conf[$::client][$::env][$name]['server_name'] {
> $server_name = $web_conf[$::client][$::env][$name]['server_name']
>   } else {
> $server_name = "${name}.${client_code}.${::env}.${domain}"
>   }
>
> The thought was that I'd have servers that follow a certain naming 
> convention and ones that don't. The ones that have 'special' names go in 
> the web_conf hash. If the manifest 'sees' a server name in the hash, it 
> should use that. If not, then it just does the 'else' bit.
>
> The trouble is that it totally fails if even the top or intermediate 
> levels of the hash don't exist. I've tried using "if 
> $web_conf[$::client][$::env][$name]['server_name'] != undef", tried "if 
> undef($web_conf[$::client][$::env][$name]['server_name'])" etc. 
>
> what's the correct way to do this?
> --steve  
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3355ea2c-0aae-436b-9098-d98a7de54dfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] PuppetConf talk proposals due in 1 week + new Puppet Camps accepting proposals

2014-03-11 Thread Dawn Foster
I wanted to remind everyone that we will only be accepting proposals
for PuppetConf 2014 until March 18th at midnight Pacific time, so you
have one week to get your talk idea submitted!

We also have several new Puppet Camps that were recently scheduled, so
we are accepting talk proposals for Puppet Camps in Tokyo, Washington
DC, Dallas, Toronto, New York and Chicago.

I've included links for all of the CFPs below:

PuppetConf September 23 - 24 in San Francisco (CFP Due March 18)
CFP form: 
https://docs.google.com/spreadsheet/viewform?formkey=dEVOeUdUOW9HeHpFekc4eDI4SUx4QUE6MA
More detail: http://puppetlabs.com/blog/submit-talk-puppetconf-2014

Puppet Camp Tokyo May 19 (CFP due March 30):
Note: LinuxCon Japan is May 20 - 22.
CFP form: 
https://docs.google.com/a/puppetlabs.com/spreadsheet/viewform?formkey=dHd6MmJqRmRILXpGSkgxci1CT2FMYmc6MA

Puppet Camp Washington DC June 5 (CFP due April 30):
CFP form: 
https://docs.google.com/spreadsheet/viewform?formkey=dHZZVlQtaDR2YlpIc1dHLUd0alBTWGc6MA

Puppet Camp Toronto Early June (CFP due April 30):
Note: DevOpsDays Toronto will be in the 1st 3 weeks of June
CFP form: 
https://docs.google.com/spreadsheet/viewform?formkey=dDUxS3JTaTljdkN3MUhsVWZMdmVoZ0E6MA

Puppet Camp Dallas June 10 (CFP due April 30)
Note: Texas Linux Fest is in Austin June 13-14
CFP form: 
https://docs.google.com/spreadsheet/viewform?formkey=dGlxZXB2aXhnR2ZpR1UwT29tdGIxZ3c6MA

Puppet Camp New York City July 8 (CFP due May 15):
Note: AWS Summit NYC is July 10
CFP form: 
https://docs.google.com/spreadsheet/viewform?formkey=dHV6MkpzRlQwVVI0OTRXc0p6M1h1OWc6MA

Puppet Camp Chicago August 19 (CFP due June 19)
Note: LinuxCon North America is August 20 - 22
CFP form: 
https://docs.google.com/spreadsheet/viewform?formkey=dEdLaFpqdU1NXzJXTl9fRG9fYm9SRUE6MA

I hope to see some of you at these events!

Regards,
Dawn Foster
Director of Community
http://puppetlabs.com/community

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAPUeXZqNLe%2BQcWLR00mx4nToq3F8jye14YoTV4HmzOuOzPxzTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] when a puppet exec resource contains several "single commands", puppet exec only fails if the last exec command fails

2014-03-11 Thread jcbollinger


On Tuesday, March 11, 2014 5:01:21 AM UTC-5, Felix.Frank wrote:
>
>
> Changing the behavior of the shell to help people who write faulty shell 
> one-liners seems like a Bad Idea to me. Tools shouldn't enable and 
> encourage bad practices. 
>
>
+1

Furthermore, it would be quite surprising and annoying for Puppet to 
automatically set a non-default option for shell commands it launches via 
an Exec, so that I have to take explicit extra action to get standard shell 
behavior.  That there is bad code out there is poor justification for 
Puppet to change its behavior to make that bad code work, especially when 
doing so would make some working code fail.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/09690434-96a3-4206-84c1-49e82f51e6ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Package requiring a class

2014-03-11 Thread kai
Nice, thanks!

On Tuesday, March 11, 2014 8:39:39 AM UTC-5, Craig Dunn wrote:
>
>
> Just to clarify, apt::source is a defined resource type, not a class.  
> Defined resource types can be required like any other resource, for example
>
> package { [ 'libvirt-bin', 'vzctl' ]:
>   ensure => present,
>   require => Apt::Source['openvz'],
> }
>
>
>
>
> On Tue, Mar 11, 2014 at 1:13 PM, kai >wrote:
>
>> I have the following two resources defined in a class:
>>
>> class openvz::install {
>>  $openvz_repo_key = hiera('openvz_repo_key')
>>  $openvz_repo = hiera('openvz_repo')
>>  $openvz_kernel_image = hiera('openvz_kernel_image')
>>  $openvz_kernel_headers = hiera('openvz_kernel_headers')
>>
>>
>> apt::source { "openvz":
>>
>> location => "$openvz_repo",
>> release => "wheezy",
>> repos => "main",
>> http_key => "$openvz_repo_key",
>> http_key_server => "$openvz_repo"
>>   }
>>
>>   package {
>> 'libvirt-bin': ensure => present;
>> 'vzctl': ensure => present;
>>   }
>>
>> }
>>
>>
>> where apt:source is an external class in a module. In most cases the package 
>> resource will run before the apt::source, causing it to fail as the apt repo 
>> is not there yet. 
>> How can I make the package resource dependent on the apt::source ? I am 
>> assuming using the "require" attribute, but in this case I am not quite sure 
>> what the best practice might be. All suggestions are highly appreciated. 
>>
>>  -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/d3f57517-c5d8-424a-b1cc-479876e55804%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> *Enviatics *| Automation and configuration management
> http://www.enviatics.com | @Enviatics
> Puppet Training http://www.enviatics.com/training/
>
>  

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/fca5fa5b-ca15-44a3-8027-267f5fd9131c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Pushing git repo to Windows agent

2014-03-11 Thread jcbollinger


On Monday, March 10, 2014 9:46:21 AM UTC-5, Nick Miller wrote:
>
> Thank you for the replies.  What I've done is setup the agent on the 
> puppet master to pull the latest version of the repo, then the agents 
> recursively pull the directory.  There are a couple of problems I'm running 
> into.  
>
> The first is that line breaks seem to be stripped from any text files the 
> nodes pull down.  On the master the file looks correct, but then on the 
> node all of the line breaks are gone.
>


Most likely the files have UNIX line endings (LF instead of CRLF).  If you 
turn on the git option "core.autocrlf" for the repo on your clients, then 
git should convert convert line termination of text files automatically.

 

>
> I occasionally run into the following error when pulling the latest 
> version of the repo:
>
> Error: /Stage[main]/Gitrepo/Vcsrepo[/tmp/git/puppet-test]: Could not 
> evaluate: Execution of '/bin/git rev-parse origin/(detached from 3c40894)' 
> returned 128: fatal: ambiguous argument 'origin/(detached from 3c40894)': 
> unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions, like this:
> 'git  [...] -- [...]'
> origin/(detached from 3c40894)
>
>

I am not enough of a git illuminatus to immediately know what that means.  
I find the appearance of the literal string '(detached from 3c40894)' 
suspicious, however.  My guess is that you are somehow creating a situation 
that vcsrepo does not handle appropriately.

 

> It seems to happen when I add a file to the repo.  In the manifest I have 
> the following:
>
> class gitrepo {
>  vcsrepo { '/tmp/git/puppet-test':
>
> ensure  => latest,
> provider=> git,
> source  => 
> "g...@bitbucket.org:user/puppet-test.git",
> revision=> 'master',
> }
>
>
> }
>


Supposing that none of the git experts around here jumps in with special 
insight on your problem, it would be helpful to identify exactly what steps 
are required to elicit the error.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e850a55b-ebe8-4187-8651-1d97361d6caa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Export variables from a manifest calling another module

2014-03-11 Thread jcbollinger


On Monday, March 10, 2014 9:27:31 AM UTC-5, Brendon Standing wrote:
>
> Hi
>
> I am busy writing puppet modules for logstash, and want to export tokens I 
> get from the hiera application or %{calling_module} role. 
>
>

There is no need for "exporting" variables *per se*, since all Puppet 
variables (and resources) have global visibility once declared.  You do 
need to use appropriate (i.e. qualified) names to access variables from a 
different scope, however, and to access them from inside a template you 
need to explain to Puppet-unaware ERB what those names mean.

 

> So each of my applications/modules that will make use of the shipper 
> module and have the inputs.conf file installed and populated will have the 
> following:
>
> class name::deployment inherits name::params {
> include logstash::shipper
> }
>
> The token I want to export for each app/module is:
> $logstash_logs = hiera('logstash_logs')
>
>

If I understand what you are proposing, it will not work as you envision.  
That is, if you put that variable declaration in class logstash::shipper, 
then the calling module that will apply is "logstash".  Moreover, you 
thereby declare only one variable, $logstash::shipper::logstash_logs, whose 
value will never change once it is set.  Puppet classes are not macros (or 
functions), and the 'include' function does not perform textual 
interpolation ala the C preprocessor.

 

> And this is taken from the %{calling_module} role like:
> logstash_logs:
> javabridge: 'javabridge-log.log'
> actions_javabridge: 'ual/actions-javabridge.log'
>
>

What you can do is put that variable declaration into some class of each 
module that needs it, then refer to the appropriate $*::logstash_logs 
variable via its full-qualified name.

Alternatively, you might be able to build a solution by converting 
logstash::shipper into a defined type, but in that case you will have an 
issue with %{calling_module} referring to to 'logstash' instead of the 
module you want.  There are ways you could work around that, I think, 
though I don't have details in mind at the moment.

 

>
> The template that is deployed via logstash::shipper has:
> <% @logstash_logs.each_pair do |key, value| -%>
>   file {
> type => "<%= key %>"
> path => [ "<%= logdir %>/<%= value %>" ]
> tags => [ "<%= key %>" ]
>   }
> <% end -%>
>
>

Again, 'include' doesn't do what you seem to suppose.  There is only one 
logstash::shipper class, and Puppet classes are idempotent: declaring a 
class multiple times (e.g. via the 'include' function) has exactly the same 
effect as declaring it exactly once.  Thus, you will only ever get one 
instance of that template if you use it only from one declaration in class 
logstash::shipper.

Also, since I alluded to it before, if a template must access a Puppet 
variable from a different scope than the one in which the template() or 
inline_template() function was called, then it can do so with the 
fully-qualified name and the lookupvar() function of the 'scope' object.  
For example,

<%  logs = scope.lookupvar('other_module::logstash_logs') %>

 

> Unfortunately the name:deployment class that is calling include 
> logstash::shipper is not passing the tokens. 
>
> The error I get is:
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Failed to parse template logstash/input.conf.erb:
>   Filepath: /usr/lib/ruby/site_ruby/1.8/puppet/parser/templatewrapper.rb
>   Line: 81
>   Detail: Could not find value for 'logstash_logs' at 
> /etc/puppet/environments/bstanding/modules/logstash/templates/input.conf.erb:1
>  at 
> /etc/puppet/environments/bstanding/modules/logstash/manifests/shipper.pp:15 
> on node free-4574-u37.dev.marinsw.net
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
>
> Any idea how best to achieve this, keeping in mind that I will need to 
> export different options for each module / app I am deploying with the 
> shipper?
>
>

If you are determined to stick to your plan of using %{calling_module} in 
your hiera configs to direct lookups to the desired logstash data, then you 
are probably going to need to write a custom function instead of a class or 
defined type.  Even then I am only about 90% certain that you can do it.

It would probably be easier, and would involve discarding less work, to 
convert your logstash::shipper class into a defined type.  You will not 
then be able to use %{calling_module} in your hiera data, but you can still 
write module-specific keys.  To work with that, logstash::shipper would use 
the automatic $calling_module_name variable (
http://docs.puppetlabs.com/puppet/latest/reference/lang_variables.html#parser-set-variables)
 
to build the hiera keys with which it looks up data.


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+unsub

Re: [Puppet Users] Package requiring a class

2014-03-11 Thread Craig Dunn
Just to clarify, apt::source is a defined resource type, not a class.
Defined resource types can be required like any other resource, for example

package { [ 'libvirt-bin', 'vzctl' ]:
  ensure => present,
  require => Apt::Source['openvz'],
}




On Tue, Mar 11, 2014 at 1:13 PM, kai  wrote:

> I have the following two resources defined in a class:
>
> class openvz::install {
> $openvz_repo_key = hiera('openvz_repo_key')
> $openvz_repo = hiera('openvz_repo')
> $openvz_kernel_image = hiera('openvz_kernel_image')
> $openvz_kernel_headers = hiera('openvz_kernel_headers')
>
>
> apt::source { "openvz":
> location => "$openvz_repo",
> release => "wheezy",
> repos => "main",
> http_key => "$openvz_repo_key",
> http_key_server => "$openvz_repo"
>   }
>
>   package {
> 'libvirt-bin': ensure => present;
> 'vzctl': ensure => present;
>   }
>
> }
>
> where apt:source is an external class in a module. In most cases the package 
> resource will run before the apt::source, causing it to fail as the apt repo 
> is not there yet.
> How can I make the package resource dependent on the apt::source ? I am 
> assuming using the "require" attribute, but in this case I am not quite sure 
> what the best practice might be. All suggestions are highly appreciated.
>
>  --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/d3f57517-c5d8-424a-b1cc-479876e55804%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Enviatics *| Automation and configuration management
http://www.enviatics.com | @Enviatics
Puppet Training http://www.enviatics.com/training/

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACxdKhF6yQfDbSZCXtJpBaxanhtO8prnTFN5%3DsJMsyo6PXUC2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what the mx mean in case

2014-03-11 Thread jcbollinger


On Monday, March 10, 2014 12:09:22 PM UTC-5, Joachim Schrod wrote:
>
> On 03/10/14 15:37, Matt Zagrabelny wrote: 
> > On Sun, Mar 9, 2014 at 5:58 PM, Teoh khah swee 
> > > 
> wrote: 
> >> HI all, 
> >> 
> >> I just come across an case statement for puppet. I would like to know 
> what 
> >> the means of the mx for below sample code? 
> >> 
> >> case $::operatingsystem { 
> >>/(?-mx:AIX)/ :{ 
> > 
> > From: 
> > 
> > http://perldoc.perl.org/perlre.html 
> > 
> > (?adlupimsx-imsx) 
> > (?^alupimsx) 
> > One or more embedded pattern-match modifiers, to be turned on (or 
> > turned off, if preceded by - ) for the remainder of the pattern or the 
> > remainder of the enclosing pattern group (if any). 
> > 
> > (?adluimsx-imsx:pattern) 
> > 
> > m: 
> > Treat string as multiple lines. That is, change "^" and "$" from 
> > matching the start or end of line only at the left and right ends of 
> > the string to matching them anywhere within the string. 
> > 
> > x: 
> > Extend your pattern's legibility by permitting whitespace and comments. 
> > 
> > I would then say that puppet is looking for AIX without capturing it 
> > and has turned off the m and x options for this pattern match. 
>
> I don't know if Ruby regexps are really exactly the same as Perl 
> regexps, but, to me as a Perl programmer, this regexp looks 
> semantically identical to /AIX/, just with some added garbage to 
> irritate people who don't know enough about regexps... ;-) 
>
>

There's no need to speculate about Perl vs. Ruby (vs. Puppet) regexes, when 
instead we can go straight to the docs: 
http://docs.puppetlabs.com/puppet/3/reference/lang_datatypes.html#regular-expressions.
  
We see there that Puppet accepts options m, x, and i, which have the same 
meaning to Puppet as to Ruby and Perl (multiline mode, (in)significant 
whitespace/comment mode, and case-insensitive mode, respectively).

Since all these options are off by default, Joachim is right: the regex 
presented means exactly the same thing as /AIX/, and explicitly declaring 
the options off does nothing but obfuscate.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/662b5fe8-5a7a-46e9-b11b-9ee5af669206%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Recursive file delete fails with empty files

2014-03-11 Thread jcbollinger


On Monday, March 10, 2014 4:13:37 PM UTC-5, Sam Tresler wrote:
>
> So, is this a known bug, by design, or something that I should figure out 
> how to file a bug report for? 
>


I don't find a bug report matching this in a quick search of the Puppet 
ticket DB.  I recommend you file one.  (Start here: 
https://tickets.puppetlabs.com/)

 

>
> I can work around it easily enough, but it seems like a recursive, forced, 
> purge shouldn't be stymied by a 0 byte file. neh? 
>
>

I completely agree, and indeed I'm surprised that such a bug has not 
previously come to light.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3a6194c6-02ed-4a12-b0ea-a38083649b8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Package requiring a class

2014-03-11 Thread kai
I have the following two resources defined in a class:

class openvz::install {
$openvz_repo_key = hiera('openvz_repo_key')
$openvz_repo = hiera('openvz_repo')
$openvz_kernel_image = hiera('openvz_kernel_image')
$openvz_kernel_headers = hiera('openvz_kernel_headers')


apt::source { "openvz":
location => "$openvz_repo",
release => "wheezy",
repos => "main",
http_key => "$openvz_repo_key",
http_key_server => "$openvz_repo"
  }

  package {
'libvirt-bin': ensure => present;
'vzctl': ensure => present;
  }

}

where apt:source is an external class in a module. In most cases the package 
resource will run before the apt::source, causing it to fail as the apt repo is 
not there yet. 
How can I make the package resource dependent on the apt::source ? I am 
assuming using the "require" attribute, but in this case I am not quite sure 
what the best practice might be. All suggestions are highly appreciated. 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d3f57517-c5d8-424a-b1cc-479876e55804%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Have to run puppet agent twice to install LDAP and ssh keys.

2014-03-11 Thread jcbollinger


On Monday, March 10, 2014 4:59:38 PM UTC-5, Christopher Wood wrote:
>
> [...] 
>
> I think you've found something interesting, namely that puppet/ruby itself 
> appears to be not using your new ldap configuration inside of a single 
> agent run process. It does work to break out ldap configuration and 
> everything else into two agent runs. This implies that something about name 
> lookups is being read when puppet starts, and then sticks around until the 
> end of the child process. (I could just be rhubarbing on.) 
>
>

Indeed, this feels like a libc issue.  I would have no problem whatsoever 
believing that the name service switch configuration is read just once, 
when the program loads, that modules not then available are not used, and 
that changes to the config made after program startup are not seen by that 
instance of the program.  In fact, although I can't find docs at the 
moment, my comments are partially informed by a vague (possibly erroneous) 
recollection that NSS works exactly that way.

That might produce particularly confusing results with Puppet, because 
Puppet performs such a mix of forking external programs for some tasks and 
using in-process Ruby for other tasks -- the former type of tasks would 
likely see the NSS changes, but the latter wouldn't.

 

> If you recreationally wanted to see what gives and maybe file a bug 
> report, you could compare two sets of puppet/nslcd strace/ltrace: 
>
> a) agent run in the original form, ldap+users in the same run 
> b) agent run in the second form as below 
>
> Also, if nscd is running, uninstalling it will provide more clarity in 
> troubleshooting. 
>
>

Yes, nscd can muddle the waters, but you should be able to get away with 
just turning it off.  It's especially pesky, though, so whether you turn it 
off or remove it altogether you may need to reboot to completely clear it 
out.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/67e5099c-b4b3-40ad-91fe-10b1e106faa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: How to check if a service Or a Package exists

2014-03-11 Thread kaustubh chaudhari
Hi John,

I totally agree with you and i am trying to do the same cleaning previous
crap!

Thanks a ton for your advice. I created a custom fact and did simple if ..
else which did the job!

Have a great day ahead!


With Warm Regards
Kaustubh.A.Chaudhari
(M)-09373102619


On Wed, Mar 5, 2014 at 1:20 PM, jcbollinger wrote:

>
>
> On Wednesday, March 5, 2014 9:40:48 AM UTC-6, kaustubh chaudhari wrote:
>>
>> Hi All,
>>
>> I need to check if a service or a package is already installed before
>> running the further code.
>>
>> Eg:
>>
>> Install bigfix package if bigfix service dose not exist.
>>
>> i know ensure => true will do this, but there is a possibility that
>> bigfix was installed from the source in c:\bigfix on few server and on few
>> its installed as a msi and i can see it under add remove programs.
>>
>> So the best way is to check if the bigfix service exists or not, if exist
>> ignore if not install via puppet.
>>
>> Any pointers ?
>>
>>
>
> The way to inform the Puppet master about the state of the target system
> before catalog compilation is via facts.  You can create a custom fact that
> uses whatever logic is appropriate to determine whether the software in
> question is installed, and then use conditionals based on that fact in your
> manifests to control whether you declare the Package or not.
>
> But you shouldn't.  Bite the bullet: bring your servers under control so
> that this sort of thing is no longer a concern.  It is really bad to
> install software from source on your production machines.  Everything ought
> to be managed via packages.
>
> If needs be you could adopt a hybrid approach: write a custom fact that
> identifies when a piece of software of interest is installed from source,
> and when that's so, tell Puppet to remove it before (re)installing it from
> a package (e.g. an MSI).  The package then does not need to be conditional,
> which is to your advantage if you ever want to use Puppet to update it or
> remove it.
>
>
> John
>
>  --
> 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/MsyNFxZ4atE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/88fd0a27-1ffa-4e7a-8a9f-9961b70cbba2%40googlegroups.com
> .
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAGceKKot9KHqbbcv7fBc6socMmDqSWzdAmOV7ZgwHgJbGp68GA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: scheduling defined resources

2014-03-11 Thread Mark deJong


On Monday, March 10, 2014 9:47:22 AM UTC-4, jcbollinger wrote:
>
>
>
> On Friday, March 7, 2014 8:57:58 AM UTC-6, Mark deJong wrote:
>>
>> Hello,
>> We're currently using version 3.4.3, and the documentation on 
>> metaparameters states "any defined metaparameter can be used with any 
>> instance in your manifest, *including defined components.*" Unless I'm 
>> missing something, this statement does not hold true to the schedule 
>> parameter which gets passed into the defines as variables.
>>
>
>
> What makes you say that?  Do you have a manifest that seems to contradict 
> that statement, and 
> http://docs.puppetlabs.com/puppet/latest/reference/lang_defined_types.html#metaparameters?
>
>  I'm having the issue with the passwd::user accepting the schedule 
metaparameter. I have tried it both with and without define the variable 
'schedule.'

class passwd (
  $module_path= $passwd::params::module_path,
  $path   = $passwd::params::path,
  $alg= $passwd::params::alg,
  $length = $passwd::params::length,
  $plugin = $passwd::params::plugin,
  $enotify= $passwd::params::enotify,
  $esubject   = $passwd::params::esubject,
  $schedule   = $passwd::params::schedule,
  $managehome = $passwd::params::managehome,
  $homeowner_override = $passwd::params::homeowner_override,
  $homeowner  = $passwd::params::homeowner,
  $homegroup  = $passwd::params::homegroup,
  $users   = [],
) inherits passwd::params {
  include passwd::virtual

  validate_absolute_path($module_path)
  validate_absolute_path($path)
  validate_string($alg)
  validate_array($enotify)
  validate_string($esubject)
  validate_array($users)
  validate_bool($managehome)
  validate_bool($homeowner_override)

  anchor {'passwd::begin': } ->
  class {'passwd::install': } ->
  class {'passwd::schedule': } ->
  class {'passwd::provision': } ->
  anchor {'passwd::end': }
}


define passwd::user (
  $password,
  $uid,
  $gid,
  $comment,
  $shell,
  $home   = "${passwd::home_root}/${name}",
  $managehome = $passwd::managehome,
  $homeowner_override = $passwd::homeowner_override,
  $homeowner  = $passwd::homeowner,
  $homegroup  = $passwd::homegroup,
  $path   = $passwd::path,
  $length = $passwd::length,
  $ensure = $passwd::ensure,
  $plugin = $passwd::plugin,
  $enotify= $passwd::enotify,
  $esubject   = $passwd::esubject,
  $schedule   = undef
){
  if ($password == 'G' and $ensure == 'present') {
$pclear = generate('/bin/sh','-c',"/bin/cat  /dev/urandom | /usr/bin/tr 
-dc 'a-zA-Z0-9' | /usr/bin/fold -w ${length} | /usr/bin/head -n 1| tr -d 
'\n'")
$pcrypt = generate('/usr/bin/openssl','passwd','-1',"'${pclear}'")
$rpassword = chomp("${pcrypt}")
notify {"${rpassword}":}
if ! empty($enotify) {
  passwd::notify { $name:
enotify  => $enotify,
username  => $name,
password => $pclear
  }
}
  }
  else {
$rpassword = $password
  }
  Augeas {
load_path => "${passwd::params::module_path}/auglenses",
lens   => "PluginPasswd.lns",
incl=> "${path}",
  }
  case $ensure {
present: {
  augeas { "pw_pl_mod_${name}":
changes => [
  "set ${name}/password '${rpassword}'",
  "set ${name}/uid '${uid}'",
  "set ${name}/gid '${gid}'",
  "set ${name}/name '${comment}'",
  "set ${name}/home '${home}'",
  "set ${name}/shell '${shell}'",
],
schedule => $schedule
  }
  if $managehome {
file { $home:
  ensure  => directory,
  owner   => homeowner_override ? {
true=> $homeowner,
default => $uid
  },
  group   => homeowner_override ? {
true=> $homeowner,
default => $gid
  },
  seltype  => user_home_dir_t,
  require => File[$passwd::home_root]
}
  }
}
absent: {
  augeas { "pw_pl_mod_${name}":
changes => [
  "rm ${name}"
]
  }
}
  }
} 


class passwd::schedule (

) inherits passwd {
  schedule { 'passwd_generate_monthly':
period => monthly,
range  => "2 - 4",
repeat => 1
  }
}


When I call passwd::user as either a resource or virtual resource, schedule 
is only honored by puppets built in functions within my define, but not  by 
passwd::user.

class passwd::virtual(
) inherits passwd {

  passwd::user{ 'johnjackson':
password => "supersecretpassword",
uid  => 121,
gid  => 121,
comment  => "User Comment",
shell=> "/bin/false",
schedule => 'passwd_generate_monthly'
  } 

  @passwd::user{ 'jimbeam':
password => "G",
uid  => 121,
gid  => 121,
comment  => "User Comment",
shell=> "/bin/false",
schedule => 'passwd_generate_monthly',
  }
}

Thanks!
M

 
>
>> Is the

Re: [Puppet Users] Problem with custom facts and hiera (solved)

2014-03-11 Thread Dirk Heinrichs
Am 11.03.2014 10:17, schrieb Dirk Heinrichs:

> To do this, I've placed a simple text file "custom_facts.txt" into
> C:\ProgramData\PuppetLabs\facter\facts.d with content
>
> [facts]
> role = PuppetDev

Got it to work by removing the blanks:

role=PuppetDev

Bye...

Dirk
-- 

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 159 (Ansage) 1149
*Email*: d...@recommind.com 
*Skype*: dirk.heinrichs.recommind
www.recommind.com 



http://www.recommind.com

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/531EF73A.6060204%40recommind.com.
For more options, visit https://groups.google.com/d/optout.
<>

Re: [Puppet Users] Problem with custom facts and hiera

2014-03-11 Thread Dirk Heinrichs
Am 11.03.2014 10:31, schrieb Craig Dunn:
> Drop the :: from your hiera.yaml, it's being taken literally as
> '::role' rather than defining scope.

That doesn't help, unfortunately. OTOH, using a predefined fact works
fine. For example, I also have a line

  - "node/%{::fqdn}"

in hiera.yaml and I can overwrite values from common.yaml with values
taken from node/myhost.recommind.com.yaml without problem.

To me it looks like facter is reading the file containing the custom
fact, while the agent does not.

Bye...

Dirk
-- 

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 159 (Ansage) 1149
*Email*: d...@recommind.com 
*Skype*: dirk.heinrichs.recommind
www.recommind.com 



http://www.recommind.com

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/531EE38C.6020604%40recommind.com.
For more options, visit https://groups.google.com/d/optout.
<>

Re: [Puppet Users] when a puppet exec resource contains several "single commands", puppet exec only fails if the last exec command fails

2014-03-11 Thread José Luis Ledesma
El 11/03/2014 11:01, "Felix Frank" 
escribió:
>
> On 03/11/2014 01:23 AM, David Arroyo wrote:
> > If it's really a problem for you, I you can always write a 'paranoid'
> > provider for exec resources.
>
> +1
>
> ...or add a parameter to exec that allows you to change the behavior of
> the shell provider.
>
> Changing the behavior of the shell to help people who write faulty shell
> one-liners seems like a Bad Idea to me. Tools shouldn't enable and
> encourage bad practices.
>
> Cheers,
> Felix
>

+1

Moroever the ser -e its just for bash, and bash is not installed by default
in most Unixes.
> --
> 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 view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/531EDEF1.9020508%40alumni.tu-berlin.de
.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAF_B3ddNr6KBd5m4UkXaS70BuMkBHGUVGKy4YkxE_aooG%3DVPEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] when a puppet exec resource contains several "single commands", puppet exec only fails if the last exec command fails

2014-03-11 Thread Felix Frank
On 03/11/2014 01:23 AM, David Arroyo wrote:
> If it's really a problem for you, I you can always write a 'paranoid'
> provider for exec resources.

+1

...or add a parameter to exec that allows you to change the behavior of
the shell provider.

Changing the behavior of the shell to help people who write faulty shell
one-liners seems like a Bad Idea to me. Tools shouldn't enable and
encourage bad practices.

Cheers,
Felix

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/531EDEF1.9020508%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] when a puppet exec resource contains several "single commands", puppet exec only fails if the last exec command fails

2014-03-11 Thread Nikola Petrov
Actually you can emulate what you want if you join the commands with &&.
Something like the following:

$command = "/bin/ls /doesnotexit; /bin/echo hello"

exec { 'cool':
command => join(split($command, '; '), " && "),
}

Note1: you will need https://github.com/puppetlabs/puppetlabs-stdlib for
this. Although I suppose you already have it.

Note2: this is not tested but it should work. Of course it written
in a generic way so you can wrap it in a define let's say.

Note3: the error messages from this can be cryptic...

P.S. Hate using execs..

-- 
Nikola


On Mon, Mar 10, 2014 at 12:57:13PM -0700, David Portabella wrote:
> I don't agree with this statement.
> in bash, for example, if you type "set -e" first, bash will stop and fail 
> as soon as a concatenated command fails.
> (i agree that this behaviour is unfortunatelly not enabled by default in 
> bash scripts)
> 
> > If you need to control each of the return codes just use different exec 
> resources
> 
> > If "you",
> the problem is that there are many puppet modules which use concatenated 
> commands, without realising about this problem.
> to be safe, I am suggesting that puppet should enable that behavior by 
> default.
> 
> > need to control each of the return codes
> i don't suggest executing every concatenated command and control each 
> return control.
> i am suggesting failing as soon as a concatenated command fails. (as in 
> bash set -e)
> > just use different exec resources
> as a side note, 
> another improvement about puppet exec would be that the exec command can be 
> an array of strings, executed in order as long as none fails.
> 
> 
> Regards,
> David
> 
> 
> On Monday, March 10, 2014 6:46:32 PM UTC+1, Jose Luis Ledesma wrote:
> >
> > When you use concatenated commands any shell will only return the last 
> > command return code by design, and this is what puppet receives. So its a ' 
> > works at a expected'
> >
> > If you need to control each of the return codes just use different exec 
> > resources
> >
> > Regards,
> > El 10/03/2014 16:02, "David Portabella" 
> > > 
> > escribió:
> >
> >>
> >> exec {'test':
> >>   command => "/bin/ls /doesnotexit", 
> >> }
> >>
> >> fails as expected:
> >>
> >> Error: /bin/ls /doesnotexit returned 1 instead of one of [0]
> >> Error: /Stage[main]//Exec[test]/returns: change from notrun to 0 failed: 
> >> /bin/ls /doesnotexit returned 1 instead of one of [0]
> >>
> >> However, 
> >> exec {'test':
> >>   command => "/bin/ls /doesnotexit; /bin/echo hello", 
> >> }
> >>
> >> does not fail, because the last command did not return an error!
> >>
> >> that's a problem, because there are many puppet modules which concatenate 
> >> several commands in one puppet exec, and they do not explicitly handle the 
> >> errors.
> >>
> >> (inserting "set -e" at the head of the command line does not work, as it 
> >> is bash script specific)
> >>
> >> *I think that, by default, the puppet exec resource should fail if any of 
> >> the "single commands" fail (as *
> >> *in the second example). and if it is not by default, at least there 
> >> should be an option in puppet exec to do so (equivalent to "set -e" in 
> >> bash)*
> >>
> >> (tested on puppet 3.3.2)
> >>
> >>
> >>  -- 
> >> 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 view this discussion on the web visit 
> >> https://groups.google.com/d/msgid/puppet-users/fc8a32ca-1e7b-4376-ace7-a1c36dd665c3%40googlegroups.com
> >> .
> >> For more options, visit https://groups.google.com/d/optout.
> >>
> >
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/73dbd33c-4d80-4631-97b9-b860eddc5f37%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140311095614.GC934%40nikolavp-desktop.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Problem with custom facts and hiera

2014-03-11 Thread Craig Dunn
Drop the :: from your hiera.yaml, it's being taken literally as '::role'
rather than defining scope.

Regards
Craig


On Tue, Mar 11, 2014 at 9:17 AM, Dirk Heinrichs  wrote:

>  Hi,
>
> I'm trying to categorize our Puppet agent nodes via custom facts. To do
> this, I've placed a simple text file "custom_facts.txt" into
> C:\ProgramData\PuppetLabs\facter\facts.d with content
>
> [facts]
> role = PuppetDev
>
> When I call facter on the agent node, I can see the new fact.
>
> On the server, I've added a line
>
>   - "role/%{::role}"
>
> into /etc/hiera.yaml, below the :hierarchy: line and restarted the master.
>
> Finally, I've added /etc/puppet/hiera/role/PuppetDev.yaml with content
>
> ---
> puppet_agent::version: 3.4.3
>
> while /etc/puppet/hiera/common.yaml has
>
> puppet_agent::version: 3.4.2
>
> To verify that the correct version is delivered, I run
>
> hiera puppet_agent::version ::role=PuppetDev
>
> and get the correct version (3.4.3) back.
>
> However, when I run the puppet agent on the node, it has role unset and
> thus it doesn't try to update the puppet agent.
>
> What am I doing wrong here?
>
> Master is 3.4.3, agents are 3.4.2.
>
> Thanks...
>
> Dirk
> --
>
> *Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
> *Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
> *Tel*: +49 2226 159 (Ansage) 1149
> *Email*: d...@recommind.com
> *Skype*: dirk.heinrichs.recommind
> www.recommind.com
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/531ED4B8.5060001%40recommind.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Enviatics *| Automation and configuration management
http://www.enviatics.com | @Enviatics
Puppet Training http://www.enviatics.com/training/

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACxdKhFd11Y9apR30w45P9GDfjBw-NxLXkVDftPs0DxBWuYx%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
<>

[Puppet Users] Problem with custom facts and hiera

2014-03-11 Thread Dirk Heinrichs
Hi,

I'm trying to categorize our Puppet agent nodes via custom facts. To do
this, I've placed a simple text file "custom_facts.txt" into
C:\ProgramData\PuppetLabs\facter\facts.d with content

[facts]
role = PuppetDev

When I call facter on the agent node, I can see the new fact.

On the server, I've added a line

  - "role/%{::role}"

into /etc/hiera.yaml, below the :hierarchy: line and restarted the master.

Finally, I've added /etc/puppet/hiera/role/PuppetDev.yaml with content

---
puppet_agent::version: 3.4.3

while /etc/puppet/hiera/common.yaml has

puppet_agent::version: 3.4.2

To verify that the correct version is delivered, I run

hiera puppet_agent::version ::role=PuppetDev

and get the correct version (3.4.3) back.

However, when I run the puppet agent on the node, it has role unset and
thus it doesn't try to update the puppet agent.

What am I doing wrong here?

Master is 3.4.3, agents are 3.4.2.

Thanks...

Dirk
-- 

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 159 (Ansage) 1149
*Email*: d...@recommind.com 
*Skype*: dirk.heinrichs.recommind
www.recommind.com 



http://www.recommind.com

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/531ED4B8.5060001%40recommind.com.
For more options, visit https://groups.google.com/d/optout.
<>