[Puppet Users] Re: Zone-file out of LDAP

2013-11-06 Thread Paul Tötterman
Hi Steven,

I want to put all the data, which is needed for my zone-files into 
 OpenLDAP. Next I need a tool, which creates zone-files out of the 
 information which is stored in OpenLDAP. 

 Have you any idea how to do that? 


http://www.venaas.no/dns/ldap2zone/

or

https://github.com/ptman/ldap-tools (although this version is buggy and I 
haven't gotten around to updating it).

Cheers,
Paul 

-- 
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/5474aefe-f399-47ad-96f6-ee965cfdf3e3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Puppet resource details using http api or puppetdb api

2013-11-06 Thread Riju Francis
Is there a way to get the package version or service status using the 
puppet api calls?

Following resource commands show version/status in the output:
puppet resource package iptables
puppet resource service iptables

Can the api be used to get similar output?

Thanks
Riju

-- 
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/2558f187-5336-4c87-adc0-6d6428768998%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: File() or Exec() temporary override?

2013-11-06 Thread jcbollinger


On Tuesday, November 5, 2013 9:11:38 AM UTC-6, Martin Langhoff wrote:

 Hi Puppeteers, 

 When you have complex/rich classes, and large numbers of machines/VMs, 
 sometimes there is a machine that needs a temporary override on a 
 file. 

 Is there a way to say something like... ? 

   node 'fqdn' { # I work for RL :-) 
   include rl_users 
   include rl_base 
   include rl_webserver # defines /etc/httpd/conf.d/foo.conf 
   ignore File['/etc/httpd/conf.d/foo.conf'] 
   } 

 or something conceptually equivalent? 

 I know of a couple inelegant options: I can disable puppet on that VM 
 for the duration, or comment out the relevant class. 

 A more precise override/ignore is of course better, as other 
 components of the configuration are still applied correctly. 



You could consider just shutting down or deactivating the puppet agent on 
the affected machine for the duration of the override.  For example, run

puppet agent --disable

there and afterward run

puppet agent --enable

.  If that's not viable, then something close to the idea you proposed 
should be possible:

node 'fqdn' { # I work for RL :-) 
  include rl_users 
  include rl_base 
  include rl_webserver
  File| title == '/etc/httpd/conf.d/foo.conf' | {
ensure = 'present',
content = undef
# override other properties to undef (no quotes)
# as needed.
  }
}


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/51512008-1240-4fe1-af23-0938f4e7c0ff%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: File() or Exec() temporary override?

2013-11-06 Thread Martin Langhoff
On Wed, Nov 6, 2013 at 9:55 AM, jcbollinger john.bollin...@stjude.org wrote:
 .  If that's not viable, then something close to the idea you proposed
 should be possible:

By should be possible, do you mean that you know or think that Puppet
supports it?

 node 'fqdn' { # I work for RL :-)
   include rl_users
   include rl_base
   include rl_webserver
   File| title == '/etc/httpd/conf.d/foo.conf' | {
 ensure = 'present',
 content = undef
 # override other properties to undef (no quotes)
 # as needed.
   }
 }

Does this syntax work, and does it elegantly override any other File
stanzas that point to that file path? Does content=undef override
'source' or do I need to also say source-undef ?

If that actually works, what other types support this trick?

thanks,




m
-- 
 martin.langh...@gmail.com
 -  ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 ~ http://docs.moodle.org/en/User:Martin_Langhoff

-- 
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/CACPiFCKrnLdT9XpQ6uXa6%2BVqBPXWTM8UohdTuhLRR0y6sn1ShQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet resource details using http api or puppetdb api

2013-11-06 Thread Nan Liu
On Tue, Nov 5, 2013 at 8:50 PM, Riju Francis rijufran...@gmail.com wrote:

 Is there a way to get the package version or service status using the
 puppet api calls?

 Following resource commands show version/status in the output:
 puppet resource package iptables
 puppet resource service iptables

 Can the api be used to get similar output?


 Puppet resource command is a face, so you can query via:

 require 'puppet'
 require 'puppet/indirector/face'

 puts Puppet::Face[:resource, '0.0.1'].find('package/linecache').to_pson

{title:linecache,exported:false,tags:[package,linecache],type:Package,parameters:{provider:gem,configfiles:keep,loglevel:notice,ensure:[0.46]}}

Look in the source code and there's additional examples such as listing all
resource of a type:

all_users = Puppet::Face[:resource, '0.0.1'].search(user)

Thanks,

Nan

-- 
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/CACqVBqBa_v4%3D3uHDR2h8SpwDb0kjdYJW%2BHLDz-icxETrsry5Ag%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet resource details using http api or puppetdb api

2013-11-06 Thread Nan Liu
On Wed, Nov 6, 2013 at 10:10 AM, Nan Liu nan@gmail.com wrote:

 On Tue, Nov 5, 2013 at 8:50 PM, Riju Francis rijufran...@gmail.comwrote:

 Is there a way to get the package version or service status using the
 puppet api calls?

 Following resource commands show version/status in the output:
 puppet resource package iptables
 puppet resource service iptables

 Can the api be used to get similar output?


  Puppet resource command is a face, so you can query via:

  require 'puppet'
  require 'puppet/indirector/face'

  puts Puppet::Face[:resource, '0.0.1'].find('package/linecache').to_pson


 {title:linecache,exported:false,tags:[package,linecache],type:Package,parameters:{provider:gem,configfiles:keep,loglevel:notice,ensure:[0.46]}}

 Look in the source code and there's additional examples such as listing
 all resource of a type:

 all_users = Puppet::Face[:resource, '0.0.1'].search(user)


Bla, have to read more carefully since subject makes a difference here, if
you want to search puppet db use (which also supplies a puppet face):

https://github.com/dalen/puppet-puppetdbquery

Nan

-- 
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/CACqVBqCUP9fcgv%2BuGg5FL8dM9Qiy_Q1LwXV9Nzheen5kyCU%2BXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Feeding errors back from custom ENC scripts

2013-11-06 Thread David Gordon
Hi All,

I'm looking at integrating our Puppet 2.7.21 setup with an internal change 
management system.  Essentially I need the master to check there is an open 
change window for a given node, and fail the run if not.

I don't want to have to have a custom configuration on all the nodes (and 
this probably wouldn't be secure anyway), so plugging this check in during 
the ENC stage seemed to make sense to me.

I'd like to be able to fail the run with a message back to the agent e.g. 
'no valid change window open'.  The problem is, as far as I can see, it is 
not possible to propagate any custom errors back to the master.  It looks 
like the only error is e.g. 'could not find node xxx' or similar.  Even 
replacing the terminus with a custom one doesn't appear to help as this 
cover-all error looks to be generated in the catalogue compiler.

Does this sound right? Anyone got an ideas if it would be possible to fail 
runs with a custom error from within the puppet master?  Failing from 
within the manifests themselves wouldn't be an option as they are under the 
control of the users, and so the check could be circumvented.

Dave

-- 
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/73d9ced2-fb17-41c7-98ac-0719cad3401d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] require a defined type from another module

2013-11-06 Thread LTH
In module A:

define A::foo()

In module B:

require A

file{bar:
require = A::foo['baz']
}

A::foo{baz:}

However puppet doesn't seem to like the syntax around 
require=A::foo['baz'].

Is there a way to do this?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/40bb7271-cda4-4480-9aee-2ebed2e8d828%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Unable to locate package postgresql-client-unknown

2013-11-06 Thread Mark Ruys
Suddenly, puppet agent won't run anymore on the master. I get the following 
error:

Info: Caching catalog for puppet.cluster.ns.nl
Info: Applying configuration version '1383770776'
Error: Execution of '/usr/bin/apt-get -q -y -o 
DPkg::Options::=--force-confold install postgresql-client-unknown' returned 
100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package postgresql-client-unknown
...

I really have no clue what the cause is and how to fix it. Anyone???

I tried apt-get update, didn't help.

-- 
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/ccd9120c-eaac-4e87-857b-e1efaf660be0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] PuppetMaster and Puppet Client in the same machine

2013-11-06 Thread Marcelo Frota
Hi Dears, 

I am installing the puppetmaster server and puppet client is running in the 
same machine.

When i running : puppet agent --test --waitforcert 30 

I received the error : 

Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources 
using 'eval_generate': SSL_connect returned=1 errno=0 state=SSLv3 read 
server certificate B: certificate verify failed: [self signed certificate 
in certificate chain for /CN=Puppet CA: HOSTNAME 
Error: /File[/var/lib/puppet/lib]: Could not evaluate: SSL_connect 
returned=1 errno=0 state=SSLv3 read server certificate B: certificate 
verify failed: [self signed certificate in certificate chain for /CN=Puppet 
CA: HOSTNAME]  Could not retrieve file metadata for 
puppet://HOSTNAME/plugins: SSL_connect returned=1 errno=0 state=SSLv3 read 
server certificate B: certificate verify failed: [self signed certificate 
in certificate chain for /CN=Puppet CA: HOSTNAME]
Error: Could not retrieve catalog from remote server: SSL_connect 
returned=1 errno=0 state=SSLv3 read server certificate B: certificate 
verify failed: [self signed certificate in certificate chain for /CN=Puppet 
CA: HOSTNAME]

I was reading about the problem and it seems is related with SSL, I made 
several tests, i change de ssldir in puppet.conf to [main] ssldir  = 
/etc/puppet/ssl and [agent] ssldir = /var/lib/puppet/ssl , but is 
not corrected the problem.

Anyone seen this? Someone can Help me ? 

Thanks
Marcelo Frota

-- 
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/3da15bb6-b9c6-48d9-a0c8-f88db1c182bf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Networker module

2013-11-06 Thread Andrei-Florian Staicu
Hi all,

I've been trying to build a module for the networker backup software,
however I don't feel confident enought to release it on the forge.
While it does the job for my needs, it lacks even the basic spec-ing. I've
been trying to get the hang of rspec-puppet, but from all the tutorials
i've read, I still couldn't understand why to test with rspec instead of
agent --test --noop, how to choose what to test in a module and how these
tests are helping, except for checking module integrity. Also, I have
exactly zero experience with ruby.

Anyway, if there's anyone who would care to take a look at the module,
provide any feedback (and maybe suggest some better lecture for rspec),
it's here:

http://github.com/smarmie/networker

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/CANK4U2p1k8jzZ_gLstE5HmjocmF1acyvqOFKt1YH49vvR5Z-Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] augeas onlyif problem

2013-11-06 Thread Jist Anidiot
I'm trying to make sure a specific user has a special ssh key used as his 
identity file.

so I'm trying something like:

 augeas{user_second_key:
context = /files/home/user/.ssh/config,
changes = [ ins IdentityFile after 
/files/home/user/.ssh/config/IdentityFile[last()],
  set /files/home/user/.ssh/config/IdentityFile[last()] 
~/.ssh/user2nd_rsa,
 ],
onlyif = match /files/home/user/.ssh/config/IdentityFile not_include 
~/.ssh/user2nd_rsa, 

  }

However it adds the line every puppet run.  I'm wondering what I might be 
doing wrong. 

-- 
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/84ee6cf2-0e49-41ee-84b4-5a960335bee9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Deployed custom facts with module do not show up

2013-11-06 Thread Sergey Sudakovich
Do deploy the module, I just do this:
puppet module install -f license-0.1.0.tar.gz
Then to test, i run 
puppet module list
/etc/puppet/modules
└──my-license (v0.1.0)

facter -p gives me the same output and facter with no parameters.


On Tuesday, November 5, 2013 5:48:46 PM UTC-8, Matthaus Litteken wrote:

 How are you deploying the module? Facter won't load module based facts by 
 default, you need to use 'facter -p' to have Facter load those facts. 

 On Tuesday, November 5, 2013, Sergey Sudakovich wrote:

 When I deploy a module I wrote with couple of custom facts, those facts 
 do not show up in factor.
 But when I point FACTORLIB to the directory with those factor, they work 
 just fine.
 I am running a masterless puppet version 2.7.22 and factor 1.7.1
 The module structure looks like so:

 -license
 ---lib
 -facter
 ---license.rb
 ---hardware_serial.rb
 -puppet


 Any idea what is causing this problem or at least where to start the 
 debugging?

 -- 
 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/58f49f57-f55c-425f-b408-1b286336ddb7%40googlegroups.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.



 -- 
 Matthaus Owens
 Release Manager, Puppet Labs

 Join us at PuppetConf 2014, September 23-24 in San Francisco


-- 
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/6aa31c1c-e492-43ae-9d79-e1acc84760a0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Unable to locate package postgresql-client-unknown [SOLVED]

2013-11-06 Thread Mark Ruys
Okay, I found the cause. For security purposes, I editted /etc/issue. As a 
result, 'facter operatingsystemrelease' did not work correctly anymore. The 
Postgress module couldn't determine correctly the proper version anymore.

Mark

Op woensdag 6 november 2013 21:52:25 UTC+1 schreef Mark Ruys:

 Suddenly, puppet agent won't run anymore on the master. I get the 
 following error:

 Info: Caching catalog for puppet.cluster.ns.nl
 Info: Applying configuration version '1383770776'
 Error: Execution of '/usr/bin/apt-get -q -y -o 
 DPkg::Options::=--force-confold install postgresql-client-unknown' returned 
 100: Reading package lists...
 Building dependency tree...
 Reading state information...
 E: Unable to locate package postgresql-client-unknown
 ...

 I really have no clue what the cause is and how to fix it. Anyone???

 I tried apt-get update, didn't help.


-- 
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/a316b433-0476-4922-a020-acb3c55f8e59%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Picking a pattern apart?

2013-11-06 Thread Matthew Barr
NOTE: of course, I just wrote this whole thing, and I think  using a hiera
lookup in the parameter might be about the same.  That's at the end of
this.I'd still like to know if it breaks scope or the renderer...

However, it might be an option for overriding params.pp settings,  without
having to do the inherit pattern on the other classes in a module?
  of course, when we get hiera 2, that'll make life much easier.




I just needed to do something a bit strange with hiera  2 modules.

I know it works, since I just ran it.. but I'm not sure it's a good idea...
 or  if it's just luck.
(Assume puppet 3.x)

Problem:
db_url  amqp_url are both set  the same across all machines in a specific
environment, but different per environment:  dev, stage, prod.

Perfect, you'd put this info into Hiera.  No problem.

Automatic lookups-This also gives the option of overriding a value from
hiera in the node scope..

So:
webserver::db_url: mysql://dev-url
webserver ::amqp_url: amqp://dev-url

+

class webserver( $db_url, $amqp_url)
{  blah
}

-
node 'Web' {
  include webserver
}

node 'WebTest' {
  class {'webserver':
 db_url= 'mysql://testbox'
  }
}



But what happens when you want to use it with a second class?  And they
need the exact same data? You clearly don't want to replicate the keys in
Hiera!

- The worker  class is screwed :)

class worker ($db_url, $amqp_url)
{ other blah }



The obvious thought is to put the data into a common key in hiera:
 - I'd also like to preserve the option of overriding a specific parameter,
like for testing with vagrant etc.

Here's the way I thought of:


---
centralconfig::db_url: mysql://dev-url
centralconfig ::amqp_url: amqp://dev-url



class webserver {
 require centralconfig
 $db_url = $centralconfig::db_url
 $amqp_url =  $centralconfig::amqp_url

blah
}


---
node 'Web' {
  include webserver
}

node 'worker' {
  include worker
}

node 'webtest' {
  class {'centralconfig':
 db_url= 'mysql://testbox'
  }
  include webserver
}




Now, if this is bad...
You could convert the automatic lookups to be actual hiera_lookup calls.

class webserver(
  $db_url = hiera('centralconfig::db_url')
  $amqp_url = hiera('centralconfig::db_url')
 ){
blah
}


And.. this might be the easiest, cleanest option..

-- 
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/CACCqFtj1aML4OpNF32X3LkafiEtGo-yecoZjMnM%3DySatVGWyFw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Deployed custom facts with module do not show up

2013-11-06 Thread Matthaus Owens
Sergey,
`facter -p` adds puppet's libdir to the load path to load module based
facts. When running against a master, facts are pluginsynced into this
directory prior to facter running. You need to make sure that the
facter directory from your module is in your puppet libdir (you can
find out what yours is set to by running `puppet agent --configprint
libdir`). So if your puppet libdir was /var/lib, your libdir should
look like the following to ensure custom facts are loaded.

var
└── lib
└── facter
├── custom_fact.rb
├── license
│   └── thing.rb
├── moar_facts.rb
├── other_fact.rb
└── root_home.rb

On Wed, Nov 6, 2013 at 1:37 PM, Sergey Sudakovich sudy...@gmail.com wrote:
 Do deploy the module, I just do this:
 puppet module install -f license-0.1.0.tar.gz
 Then to test, i run
 puppet module list
 /etc/puppet/modules
 └──my-license (v0.1.0)

 facter -p gives me the same output and facter with no parameters.


 On Tuesday, November 5, 2013 5:48:46 PM UTC-8, Matthaus Litteken wrote:

 How are you deploying the module? Facter won't load module based facts by
 default, you need to use 'facter -p' to have Facter load those facts.

 On Tuesday, November 5, 2013, Sergey Sudakovich wrote:

 When I deploy a module I wrote with couple of custom facts, those facts
 do not show up in factor.
 But when I point FACTORLIB to the directory with those factor, they work
 just fine.
 I am running a masterless puppet version 2.7.22 and factor 1.7.1
 The module structure looks like so:

 -license
 ---lib
 -facter
 ---license.rb
 ---hardware_serial.rb
 -puppet


 Any idea what is causing this problem or at least where to start the
 debugging?

 --
 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/58f49f57-f55c-425f-b408-1b286336ddb7%40googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



 --
 Matthaus Owens
 Release Manager, Puppet Labs

 Join us at PuppetConf 2014, September 23-24 in San Francisco

 --
 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/6aa31c1c-e492-43ae-9d79-e1acc84760a0%40googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.



-- 
Matthaus Owens
Release Manager, Puppet Labs

Join us at PuppetConf 2014, September 23-24 in San Francisco

-- 
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%3DwAfyO8ZyVWr%3DC8GUqv8hW%2B8aSnV6tRfXvuUnp41dVhWmSw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Deployed custom facts with module do not show up

2013-11-06 Thread Sergey Sudakovich
Aha, I see so my puppet libdir is /var/lib/puppet/lib, but why when I 
install a module, it goes into /etc/puppet/modules?

On Wednesday, November 6, 2013 5:07:39 PM UTC-8, Matthaus Litteken wrote:

 Sergey, 
 `facter -p` adds puppet's libdir to the load path to load module based 
 facts. When running against a master, facts are pluginsynced into this 
 directory prior to facter running. You need to make sure that the 
 facter directory from your module is in your puppet libdir (you can 
 find out what yours is set to by running `puppet agent --configprint 
 libdir`). So if your puppet libdir was /var/lib, your libdir should 
 look like the following to ensure custom facts are loaded. 

 var 
 └── lib 
 └── facter 
 ├── custom_fact.rb 
 ├── license 
 │   └── thing.rb 
 ├── moar_facts.rb 
 ├── other_fact.rb 
 └── root_home.rb 

 On Wed, Nov 6, 2013 at 1:37 PM, Sergey Sudakovich 
 sud...@gmail.comjavascript: 
 wrote: 
  Do deploy the module, I just do this: 
  puppet module install -f license-0.1.0.tar.gz 
  Then to test, i run 
  puppet module list 
  /etc/puppet/modules 
  └──my-license (v0.1.0) 
  
  facter -p gives me the same output and facter with no parameters. 
  
  
  On Tuesday, November 5, 2013 5:48:46 PM UTC-8, Matthaus Litteken wrote: 
  
  How are you deploying the module? Facter won't load module based facts 
 by 
  default, you need to use 'facter -p' to have Facter load those facts. 
  
  On Tuesday, November 5, 2013, Sergey Sudakovich wrote: 
  
  When I deploy a module I wrote with couple of custom facts, those 
 facts 
  do not show up in factor. 
  But when I point FACTORLIB to the directory with those factor, they 
 work 
  just fine. 
  I am running a masterless puppet version 2.7.22 and factor 1.7.1 
  The module structure looks like so: 
  
  -license 
  ---lib 
  -facter 
  ---license.rb 
  ---hardware_serial.rb 
  -puppet 
  
  
  Any idea what is causing this problem or at least where to start the 
  debugging? 
  
  -- 
  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 javascript:. 
  To view this discussion on the web visit 
  
 https://groups.google.com/d/msgid/puppet-users/58f49f57-f55c-425f-b408-1b286336ddb7%40googlegroups.com.
  

  For more options, visit https://groups.google.com/groups/opt_out. 
  
  
  
  -- 
  Matthaus Owens 
  Release Manager, Puppet Labs 
  
  Join us at PuppetConf 2014, September 23-24 in San Francisco 
  
  -- 
  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 javascript:. 
  To view this discussion on the web visit 
  
 https://groups.google.com/d/msgid/puppet-users/6aa31c1c-e492-43ae-9d79-e1acc84760a0%40googlegroups.com.
  

  
  For more options, visit https://groups.google.com/groups/opt_out. 



 -- 
 Matthaus Owens 
 Release Manager, Puppet Labs 

 Join us at PuppetConf 2014, September 23-24 in San Francisco 


-- 
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/6535d35d-aef4-4dce-9675-67c5c44d3e99%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Can't get puppet manifest to run

2013-11-06 Thread Philippe Conway
So I am an UBER-NOOB at Puppet. Today is my first day using it. I am 
following along with the book: Puppet 3 Beginners guide.

Everything was going fine until I start creating a nodes.pp file and 
applying the site.pp.

*The error I am getting is this:*

[root@puppet-san2 manifests]# puppet apply site.pp
Error: Could not find default node or by name with 'puppet-san2.domain.com, 
puppet-san2.domain, puppet-san2' on node puppet-san2.domain.com
Error: Could not find default node or by name with 'puppet-san2.domain.com, 
puppet-san2.domain, puppet-san2' on node puppet-san2.domain.com


*This is my site.pp:*

import 'nodes.pp'


*This is my nodes.pp:*

node 'demo' {
  file { '/tmp/hello':
content = Hello, world\n,
  }
}


My puppet server is in DNS and resolves properly. So I'm at a loss. Any 
thoughts? I am running puppet community edition 3.3.1 on  a CentOS 6.4 
server

Any help would be greatly appreciated. Thanks!

- Philippe

-- 
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/0778d8c4-9ac9-46cd-a2b3-7e0a813552c5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Can't get puppet manifest to run

2013-11-06 Thread Gabriel Filion
hello,

On 06/11/13 08:29 PM, Philippe Conway wrote:
 So I am an UBER-NOOB at Puppet. Today is my first day using it. I am
 following along with the book: Puppet 3 Beginners guide.
 
 Everything was going fine until I start creating a nodes.pp file and
 applying the site.pp.

nodes need to be matched by fqdn in your manifests.

 *The error I am getting is this:*
 
 [root@puppet-san2 manifests]# puppet apply site.pp
 Error: Could not find default node or by name with
 'puppet-san2.domain.com, puppet-san2.domain, puppet-san2' on node
 puppet-san2.domain.com
 Error: Could not find default node or by name with
 'puppet-san2.domain.com, puppet-san2.domain, puppet-san2' on node
 puppet-san2.domain.com

according to the above, your host has an fqdn of puppet-san2.domain.com, so

 *This is my nodes.pp:*
 
 node 'demo' {
   file { '/tmp/hello':
 content = Hello, world\n,
   }
 }

here you could rename that node to:

node 'puppet-san2' {

or

node 'puppet-san2.domain' {

or

node 'puppet-san2.domain.com' {


or you could have a node named default that would be used when puppet
can't match with anything else, although from personal experience I
don't recomment using the default node since this can lead to pretty
annoying surprises when you forget to create your node and run puppet on
the client.

-- 
Gabriel Filion



signature.asc
Description: OpenPGP digital signature


Re: [Puppet Users] Picking a pattern apart?

2013-11-06 Thread Dan Bode
Hi Matthew,

FWIW, I ran into the same issue, and wound up creating an abstraction layer
on top of my hiera lookups to do this:

It does a lot more than what you are asking for, but I thought it was worth
mentioning since it was written to solve the same problem.


https://github.com/bodepd/scenario_node_terminus/blob/master/README.md#data-mappings


On Wed, Nov 6, 2013 at 3:41 PM, Matthew Barr mb...@mbarr.net wrote:

 NOTE: of course, I just wrote this whole thing, and I think  using a hiera
 lookup in the parameter might be about the same.  That's at the end of
 this.I'd still like to know if it breaks scope or the renderer...

 However, it might be an option for overriding params.pp settings,  without
 having to do the inherit pattern on the other classes in a module?
   of course, when we get hiera 2, that'll make life much easier.


 

 I just needed to do something a bit strange with hiera  2 modules.

 I know it works, since I just ran it.. but I'm not sure it's a good
 idea...  or  if it's just luck.
 (Assume puppet 3.x)

 Problem:
 db_url  amqp_url are both set  the same across all machines in a specific
 environment, but different per environment:  dev, stage, prod.

 Perfect, you'd put this info into Hiera.  No problem.

 Automatic lookups-This also gives the option of overriding a value
 from hiera in the node scope..

 So:
 webserver::db_url: mysql://dev-url
 webserver ::amqp_url: amqp://dev-url

 +

 class webserver( $db_url, $amqp_url)
 {  blah
 }

 -
 node 'Web' {
   include webserver
 }

 node 'WebTest' {
   class {'webserver':
  db_url= 'mysql://testbox'
   }
 }
 


 But what happens when you want to use it with a second class?  And they
 need the exact same data? You clearly don't want to replicate the keys in
 Hiera!

 - The worker  class is screwed :)

 class worker ($db_url, $amqp_url)
 { other blah }



 The obvious thought is to put the data into a common key in hiera:
  - I'd also like to preserve the option of overriding a specific
 parameter, like for testing with vagrant etc.

 Here's the way I thought of:


 ---
 centralconfig::db_url: mysql://dev-url
 centralconfig ::amqp_url: amqp://dev-url

 

 class webserver {
  require centralconfig
  $db_url = $centralconfig::db_url
  $amqp_url =  $centralconfig::amqp_url

 blah
 }


 ---
 node 'Web' {
   include webserver
 }

 node 'worker' {
   include worker
 }

 node 'webtest' {
   class {'centralconfig':
  db_url= 'mysql://testbox'
   }
   include webserver
 }


 

 Now, if this is bad...
 You could convert the automatic lookups to be actual hiera_lookup calls.

 class webserver(
   $db_url = hiera('centralconfig::db_url')
   $amqp_url = hiera('centralconfig::db_url')
  ){
 blah
 }


 And.. this might be the easiest, cleanest option..





  --
 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/CACCqFtj1aML4OpNF32X3LkafiEtGo-yecoZjMnM%3DySatVGWyFw%40mail.gmail.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/CA%2B0t2LxjgVDjzs4Fcrj-xHrWE7y-yjq0NdZ1xa6Lo2esF%3D%2B%3DVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Can't get puppet manifest to run

2013-11-06 Thread Philippe Conway
Gabriel,

That is exactly what the problem was. I somehow did not catch that in the 
reading. I think I was just too excited. :)

Thanks for your help!

On Wednesday, November 6, 2013 6:14:41 PM UTC-8, Lelutin wrote:

 hello, 

 On 06/11/13 08:29 PM, Philippe Conway wrote: 
  So I am an UBER-NOOB at Puppet. Today is my first day using it. I am 
  following along with the book: Puppet 3 Beginners guide. 
  
  Everything was going fine until I start creating a nodes.pp file and 
  applying the site.pp. 

 nodes need to be matched by fqdn in your manifests. 

  *The error I am getting is this:* 
  
  [root@puppet-san2 manifests]# puppet apply site.pp 
  Error: Could not find default node or by name with 
  'puppet-san2.domain.com, puppet-san2.domain, puppet-san2' on node 
  puppet-san2.domain.com 
  Error: Could not find default node or by name with 
  'puppet-san2.domain.com, puppet-san2.domain, puppet-san2' on node 
  puppet-san2.domain.com 

 according to the above, your host has an fqdn of puppet-san2.domain.com, 
 so 

  *This is my nodes.pp:* 
  
  node 'demo' { 
file { '/tmp/hello': 
  content = Hello, world\n, 
} 
  } 

 here you could rename that node to: 

 node 'puppet-san2' { 

 or 

 node 'puppet-san2.domain' { 

 or 

 node 'puppet-san2.domain.com' { 


 or you could have a node named default that would be used when puppet 
 can't match with anything else, although from personal experience I 
 don't recomment using the default node since this can lead to pretty 
 annoying surprises when you forget to create your node and run puppet on 
 the client. 

 -- 
 Gabriel Filion 



-- 
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/94d0eac9-58e2-43de-8669-4f853c1cdf60%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] require a defined type from another module

2013-11-06 Thread Trevor Vaughan
Try A:Foo instead of A::foo.

Trevor


On Wed, Nov 6, 2013 at 3:45 PM, LTH lthar...@vcu.edu wrote:

 In module A:

 define A::foo()

 In module B:

 require A

 file{bar:
 require = A::foo['baz']
 }

 A::foo{baz:}

 However puppet doesn't seem to like the syntax around
 require=A::foo['baz'].

 Is there a way to do this?

 Thanks in advance.

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/40bb7271-cda4-4480-9aee-2ebed2e8d828%40googlegroups.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaug...@onyxpoint.com

-- This account not approved for unencrypted proprietary information --

-- 
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/CANs%2BFoVGhToD-wApzL4oYs2LD6sB7v0K6%3DSoLeSJNRtP1z60aQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Version Controlling Puppet Configs with svn

2013-11-06 Thread Salient Digital
Note that git recognizes and stores file attribute changes (whereas svn 
does not). 

On Tuesday, October 29, 2013 6:53:59 PM UTC-7, Hyunil Shin wrote:

 Hello.

 I have the same issue with you, except that I am using Git.
 Can you describe your solution in more details?
 As you said that /etc/puppet (in my case, /etc/puppetlabs) has mixed 
 ownership of root, pe-puppet, how can you check-out puppet configuration 
 from the svn server, with preserving permission and ownership?

 Thank you


 On Tuesday, May 7, 2013 2:17:33 AM UTC+9, P Cornellio wrote:

 That's correct, my concern is permissions/ownership changes inside 
 /etc/puppet on the master after doing commits/check-outs, especially when 
 new manifests are added on clients, outside of the master, then committed 
 to the repo and updated onto the master.  Our master currently has mixed 
 ownership between both root and pe-puppet user.  I will go with the 
 approach of using the pe-puppet user on the master.


 On Monday, May 6, 2013 5:43:20 AM UTC-7, Bernardo Costa wrote:

 I suppose your concerns are about the check-outs of the svn repo on the 
 puppet root direcctory, not about permissions and ownership inside the 
 repo. Once you do svn co command as your user (not recommended), the new 
 files will be created having being owned by you. It might fail if you user 
 does not have permission tho create or modify these files inside the puppet 
 tree source file. The best thing to do is run the svn co command as user 
 puppet but you'll need to set its password or a sudo set of commands.

 Em domingo, 5 de maio de 2013 00h58min18s UTC-3, P Cornellio escreveu:

 Hi,

 I an in the process of putting my Puppet Master configs into version 
 control using SVN.  I'm concerned about file permission and ownership 
 changes as a result of this.  SVN does not store permissions.  How does 
 one 
 safely use SVN with puppet configs?  

 Cheers,

 Pete


On Tuesday, October 29, 2013 6:53:59 PM UTC-7, Hyunil Shin wrote:

 Hello.

 I have the same issue with you, except that I am using Git.
 Can you describe your solution in more details?
 As you said that /etc/puppet (in my case, /etc/puppetlabs) has mixed 
 ownership of root, pe-puppet, how can you check-out puppet configuration 
 from the svn server, with preserving permission and ownership?

 Thank you


 On Tuesday, May 7, 2013 2:17:33 AM UTC+9, P Cornellio wrote:

 That's correct, my concern is permissions/ownership changes inside 
 /etc/puppet on the master after doing commits/check-outs, especially when 
 new manifests are added on clients, outside of the master, then committed 
 to the repo and updated onto the master.  Our master currently has mixed 
 ownership between both root and pe-puppet user.  I will go with the 
 approach of using the pe-puppet user on the master.


 On Monday, May 6, 2013 5:43:20 AM UTC-7, Bernardo Costa wrote:

 I suppose your concerns are about the check-outs of the svn repo on the 
 puppet root direcctory, not about permissions and ownership inside the 
 repo. Once you do svn co command as your user (not recommended), the new 
 files will be created having being owned by you. It might fail if you user 
 does not have permission tho create or modify these files inside the puppet 
 tree source file. The best thing to do is run the svn co command as user 
 puppet but you'll need to set its password or a sudo set of commands.

 Em domingo, 5 de maio de 2013 00h58min18s UTC-3, P Cornellio escreveu:

 Hi,

 I an in the process of putting my Puppet Master configs into version 
 control using SVN.  I'm concerned about file permission and ownership 
 changes as a result of this.  SVN does not store permissions.  How does 
 one 
 safely use SVN with puppet configs?  

 Cheers,

 Pete



-- 
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/a3696a40-901f-472e-9336-9c23722af8f7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Learning puppet rapid-fire workflow questions

2013-11-06 Thread Salient Digital
Thanks in advance for your advice. 

I'm a beginner running puppet on 1 server running Debian Wheezy following 
along with the Learning docs.

Is this configuration what is referred to  masterless? If so, it seems 
agent less would make more sense to me, I'm just curious if I understand 
the terminology correctly. In this setup, do I need to use agent?

I've managed to install some modules from Puppet forge, eg., 
puppetlabs-mysql … and see they have gone to /etc/puppet/ - are these meant 
to be overridden by copies I put in to my local configuration? 
Specifically, the blank init.pp? Or, should I just make changes to the one 
in the module folder?

I'm immediately wanting to put my changes into revision control. 

Would I be better off cloning or forking existing modules on Github, 
e.g. https://github.com/puppetlabs/puppetlabs-mysql in this case?

When should I put something into site.pp vs a module's init.pp (that I 
forked/modified), vs some custom file location?

Ultimately I want to manage a LAMP environment in EC2. Where in the 
puppetlabs/mysql module is the version number of the server defined? Same 
question for puppetlabs/apache and PHP with the extensions I need, e.g. 
mcrypt, memcache, etc.

I've installed LAMP stack software so many times, I know how I would do it 
manually, but I'm having trouble understanding where versions and 
dependencies get defined for a puppet-managed install of these softwares. 




-- 
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/37797158-bd05-4288-b346-b71e34aa8636%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Logging configuration

2013-11-06 Thread Roumen
Billy The Chip billythechip at gmail.com writes:

 
 
 On Tue, Apr 19, 2011 at 6:30 AM, Ben Hughes ben at puppetlabs.com wrote:
 On Mon, Apr 18, 2011 at 09:16:13AM -0700, Kal McFate wrote:
  How do I tell puppet to log somewhere other than /var/log/messages. None of
  the logging configuration options seem to do anything any more. Specifically
  puppetdlog.
 /var/log/messages, will, I presume, be your syslog daemon's logging.
 It logs at syslogfacility daemon by default. Set syslogfacility to
 a different level in your puppet.conf and adjust your syslog accordingly.
 Or you may use --logdest /path/to/file on the command line if you wish.
 
 
 
 
 As an additional option, you can use rsyslog, which is the default in
recent Redhat-ish distributions and has been available since RH5.2. It's
also available for many other Linux 
 and non-Linux platforms.On RHEL5, the following works (put this in
/etc/rsyslog.conf)::programname, isequal, puppet-agent
/var/log/puppet/agent.log:programname, isequal, puppet-agent ~This might
also work for later releases of rsyslog, nevertheless, on Fedora = 10 and
RHEL6 we use:if $programname == 'puppet-agent' and $syslogseverity = '6'
then /var/log/puppet/agent.log
 if $programname == 'puppet-agent' and $syslogseverity = '6' then ~HTH,Gerald
 


Just wanted to add, here's how you add a --logdest= option to the two
major distributions: redhat and Debian:
On redhat, add PUPPET_LOG=/var/log/puppet-agent.log to /etc/sysconfig/puppet
On Debian, add to /etc/default/puppet the following:
LOG_DEST=/var/log/puppet-agent.log
DAEMON_OPTS=--logdest=${LOG_DEST}
--




-- 
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/loom.20131107T081150-185%40post.gmane.org.
For more options, visit https://groups.google.com/groups/opt_out.