[Puppet Users] Portability of class parameters

2014-04-28 Thread Jared Ballou
Hi everyone,

Now that I am starting to move from a primarily Hiera/YAML data backend to 
using Foreman smart parameters, I am encountering an issue that I'd like to 
see if anyone has dealt with. In Hiera, I use RI Pienaar's module_data 
module so that I can build a data structure in every module, this allows me 
to completely remove the kludgy class::params class method of setting 
default variables with logic. This also makes the module a self-contained 
object with the data and sane defaults, with hierarchy and logic, as a 
Forge module and publish it. Moving to Foreman, I am looking at finding a 
smart way to do the two use cases this addresses:
1. Export my Foreman parameters, with matchers and overrides, as a standard 
text format to be included with the module. This can be JSON, XML, SQL, 
whatever, as long as it is text, and can be imported safely by Foreman 
along with the class to pre-populate the parameters.
2. Import a brand-new unknown class to the environment, and have all the 
data and sane defaults imported, with conditionals, as Foreman parameters. 
This should import the file in Step 1, otherwise the old-style import 
matching can be used.

If anyone has worked on anything like this, I'd like to see it. I am a 
terrible Ruby programmer, so I am not ready to start building plugins 
myself to address this, but I am more than willing to help develop and test 
something to help address this issue. At minimum, I'm interested in hearing 
how other people have handled this issue.

Thanks,

-Jared

-- 
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/46b3b226-741a-461d-a642-fe2c9311ec50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Error 400 on Server: 0 is not a string. It looks to be a Fixnum on node example.test.net

2014-04-28 Thread Tony Zhao
This gist has the debug output:
https://gist.github.com/touchdown/190fe8eca878b82fc71b

I realize that it came from running the postgresql setup in puppetdb 
module. I am running both postgresql locally so i simply declare both 
classes with default params.

On Monday, April 28, 2014 8:51:35 AM UTC-4, Ken Barber wrote:
>
> Can you paste the full error in a gist (with surrounding content as 
> well) instead of just putting it in a subject line? 
>
> If you can run the failing component with --debug so we can see more 
> verbose output next to the error that might be also useful. If this 
> error is being logged by your master, you should run the master using 
> --no-daemonize and --debug perhaps. 
>
> ken. 
>
> On Mon, Apr 28, 2014 at 3:38 AM, Tony Zhao > 
> wrote: 
> > This is the error I got running puppetlab's puppetdb module trying to 
> setup 
> > puppetdb and postgresql. I was able to run it locally with puppet apply. 
> > 
> > I am running puppet 3.5.1 on both master and agent with hiera. Master is 
> > running Apache+Passenger. 
> > 
> > Has anyone encounter similar issue before and can provide some insights? 
> > 
> > -- 
> > 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/461d498b-22d6-4b39-bc44-1e4d94a1e75b%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/a8bcbc44-67d9-4950-9a5c-bc33cf9603ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] facter for debian: missing '_all.deb' version

2014-04-28 Thread JonY
In the past I've worked around this by creating a stub version of 
dmidecode. facter is happy.

On Monday, April 28, 2014 11:59:52 AM UTC-7, Matthaus Litteken wrote:
>
> This issue is being tracked at 
> https://tickets.puppetlabs.com/browse/CPR-5. The core of the problem 
> is that facter is not an all arch package. It depends on dmidecode, 
> which is not available for all architectures. Because of this, facter 
> is an arch dependent package and there is no all package for it. There 
> is more detail in the linked ticket. 
>
> HTH 
>
> On Mon, Apr 28, 2014 at 7:52 AM, JonY > 
> wrote: 
> > To the build-czars at puppet labs: could you please include a 
> "*_all.deb" 
> > version of facter in your build cycle? It doesn't appear to have been 
> > created since v 1.6.18. 
> > 
> > My clients are almost exclusively ARM based and can't upgrade without 
> this 
> > being available. 
> > 
> > Humbly yours, me. 
> > 
> > -- 
> > 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/d01e58d1-70a1-47ae-b802-d49473d2d5b0%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> Matthaus Owens 
> Puppet Labs 
>
> Join us at PuppetConf 2014, September 22-24 in San Francisco 
> Register by May 30th to take advantage of the Early Adopter discount —save 
> $349! 
>

-- 
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/f419ea9f-8e43-404c-9c63-e28bf0232839%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Hiera error apply catalog

2014-04-28 Thread Garrett Honeycutt
On 4/28/14, 5:06 PM, mike wrote:
> Hi everyone,
> I learning Hiera for my Puppet configuration but I've the error when i
> execute the node connection.
> 
> []
> Error: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Could not find data item apache_package in any Hiera data file
> and no default supplied at
> /etc/puppet/modules/apache/manifests/init.pp:2 on node node2.example.com
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
> []
> 
> But when i check data depending  returns nil
> 
> []
> [root@master puppet]# hiera -c hiera.yaml apache_package osfamily=Debian
> nil
> [root@master puppet]# hiera -c hiera.yaml apache_package osfamily=RedHat
> nil
> []
> 
> Hiera yaml file
> 
> []
> [root@master puppet]# cat hieradata/RedHat.yaml 
> ­­­
> apache_package: 'httpd'
> apache_service: 'httpd'
> 
> [root@master puppet]# cat hieradata/Debian.yaml 
> ­­­
> apache_package: 'apache2'
> apache_service: 'apache'
> []
> 
> []
> [root@master puppet]# cat hiera.yaml 
> ---
> :backends: - yaml
>  
> :hierarchy:
>   - %{osfamily}
>   - common
>  
> :yaml:
>   :datadir: /etc/puppet/hieradata/
> []
> 
> Thanks.

Hi,

Check that /etc/puppet/hiera.yaml and /etc/hiera.yaml are both symlinks
to /var/lib/hiera/hiera.yaml.

Best regards,
-g


-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
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/535EC4FB.6070408%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Hiera error apply catalog

2014-04-28 Thread mike
Hi everyone,
I learning Hiera for my Puppet configuration but I've the error when i 
execute the node connection.

[]
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not find data item apache_package in any Hiera data file and no 
default supplied at /etc/puppet/modules/apache/manifests/init.pp:2 on node 
node2.example.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[]

But when i check data depending  returns nil

[]
[root@master puppet]# hiera -c hiera.yaml apache_package osfamily=Debian
nil
[root@master puppet]# hiera -c hiera.yaml apache_package osfamily=RedHat
nil
[]

Hiera yaml file

[]
[root@master puppet]# cat hieradata/RedHat.yaml 
­­­
apache_package: 'httpd'
apache_service: 'httpd'

[root@master puppet]# cat hieradata/Debian.yaml 
­­­
apache_package: 'apache2'
apache_service: 'apache'
[]

[]
[root@master puppet]# cat hiera.yaml 
---
:backends: - yaml
 
:hierarchy:
  - %{osfamily}
  - common
 
:yaml:
  :datadir: /etc/puppet/hieradata/
[]

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/6bc700db-4df0-4e21-b4ad-96ecbd5a5210%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Looking for a better way to use hiera hashes than create_resources

2014-04-28 Thread Alex Scoble
Sorry, this is what happens when I'm too tired. I see all the pieces now. 
The types module is using create_resources() as well as the hiera_hash() 
function.

I'll read the collectors documentation again.

Any idea why R.I. Pienaar thinks that it's a bad idea to use the 
create_resources() function?

Thanks,

Alex

On Monday, April 28, 2014 1:19:50 PM UTC-7, Alex Scoble wrote:
>
> I think I get it now.
>
> The types module is actually a wrapper for tying hiera hash data to the 
> three built in types, but this pattern could also be used with a defined 
> type perhaps?
>
> Thanks,
>
> Alex
>
> On Monday, April 28, 2014 1:05:55 PM UTC-7, Alex Scoble wrote:
>>
>> Hi Garrett,
>>
>> Thanks for the response. The module you posted does indeed help as it 
>> shows how to deal with hashes of hiera data without using the 
>> create_resources() function.
>>
>> Thanks,
>>
>> Alex
>>
>>
>>>
>>> Hi, 
>>>
>>> The create_resources() function allows you to have a data driven design. 
>>> This gives you the ability to specify arbitrary data in Hiera and 
>>> decouple data from modules. It means you can change the data without the 
>>> code. I would argue that any define in your module should have a 
>>> corresponding create_resources() function, so that it can be accessed 
>>> through data in Hiera. 
>>>
>>> As for ordering, your defines should probably take care of that, though 
>>> you can use collections with chaining to help, such as 
>>>
>>>   Virt::Foo <||> -> Virt::Bar <||> 
>>>
>>> When you are using create_resources(), I recommend also specifying an 
>>> option to use hiera_hash() to collect your hashes. This does a deep hash 
>>> merge and will return values from all levels of the hierarchy. My types 
>>> module[1] is an example of this that lets you define file, mount, and 
>>> cron resources as hashes. 
>>>
>>> [1] - https://github.com/ghoneycutt/puppet-module-types 
>>>
>>> Best regards, 
>>> -g 
>>>
>>> -- 
>>> Garrett Honeycutt 
>>> @learnpuppet 
>>> Puppet Training with LearnPuppet.com 
>>> Mobile: +1.206.414.8658 
>>>
>>

-- 
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/eca95701-2e41-4c9c-b861-9e3e9a602622%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Augeas Question

2014-04-28 Thread Kenton Brede
Not ab augeas expert but IIRC what I did in a similar situation is force
puppet/augeas to point to only one file.

Try adding "context," "incl," and "lens" to your augeas definition, like
the example below.  By specifying the lens, I think it helps speed up the
augeas type also.  At least I read that somewhere.  :)

  augeas { 'selinux_config':
context => '/files/etc/selinux/config',
incl=> '/etc/selinux/config',
lens=> 'Shellvars.lns',
changes => "set SELINUX ${selinux_state}",
  }

If I need to customize a lens, I stick it in /usr/share/augeas/lenses and
manage it with puppet.  I leave the lenses in /dist/ alone.
Kent


On Mon, Apr 28, 2014 at 2:56 PM, Pete Hartman wrote:

> I hope this is an appropriate place for this question; if not, any
> redirection to a more appropriate place is appreciated.
>
> So: I'm trying to set up puppet + augeas on an opensolaris system.  There
> are certain files I have that are under RCS version control--this is not
> all my doing, so some of these things I cannot change.  This creates files
> under /etc/ that are like "filename,v".
>
> I'm using puppet 2.7.22 and augeas 1.0.0.
>
> Well, augtool, and apparently augeas invoked via puppet throw up on this.
>  Augtool reports
>
> Failed to initialize Augeas
> error: Invalid path expression
> error: garbage at end of path expression
> /augeas/files/etc/default/nfs|=|,v
>
> I just want augeas to ignore these files...
>
> I think the answer is to modify the
> /usr/local/share/augeas/lenses/dist/*.aug files that refer to things that
> are causing this grief and add excl clauses to explicitly exclude anything
> *,v.
>
> For example in shellvars.aug we have
>
> let filter_default = incl "/etc/default/*"
> . excl "/etc/default/grub_installdevice*"
> . excl "/etc/default/whoopsie"
>
> I've added
> . excl "/etc/default/*,v"
>
> This appears to work.  But I'm not sure this is the "right" solution --
> should I perhaps be making a copy of this to somewhere else and override
> the dist version?  Is there a more global way I could say "ignore all files
> that have ,v after them" ?
>
> Thanks
>
> 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/017535fd-ff18-48e5-83eb-50d5f35b1a9e%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Kent Brede

-- 
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%2BnSE38O8YSwLa9fbA1NCihs6DaHqkZedShiHPd_%2B%2BgdZ1z%2BKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Looking for a better way to use hiera hashes than create_resources

2014-04-28 Thread Alex Scoble
I think I get it now.

The types module is actually a wrapper for tying hiera hash data to the 
three built in types, but this pattern could also be used with a defined 
type perhaps?

Thanks,

Alex

On Monday, April 28, 2014 1:05:55 PM UTC-7, Alex Scoble wrote:
>
> Hi Garrett,
>
> Thanks for the response. The module you posted does indeed help as it 
> shows how to deal with hashes of hiera data without using the 
> create_resources() function.
>
> Thanks,
>
> Alex
>
>
>>
>> Hi, 
>>
>> The create_resources() function allows you to have a data driven design. 
>> This gives you the ability to specify arbitrary data in Hiera and 
>> decouple data from modules. It means you can change the data without the 
>> code. I would argue that any define in your module should have a 
>> corresponding create_resources() function, so that it can be accessed 
>> through data in Hiera. 
>>
>> As for ordering, your defines should probably take care of that, though 
>> you can use collections with chaining to help, such as 
>>
>>   Virt::Foo <||> -> Virt::Bar <||> 
>>
>> When you are using create_resources(), I recommend also specifying an 
>> option to use hiera_hash() to collect your hashes. This does a deep hash 
>> merge and will return values from all levels of the hierarchy. My types 
>> module[1] is an example of this that lets you define file, mount, and 
>> cron resources as hashes. 
>>
>> [1] - https://github.com/ghoneycutt/puppet-module-types 
>>
>> Best regards, 
>> -g 
>>
>> -- 
>> Garrett Honeycutt 
>> @learnpuppet 
>> Puppet Training with LearnPuppet.com 
>> Mobile: +1.206.414.8658 
>>
>

-- 
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/debd6399-3c00-423d-b57f-52c3d26a1d3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Looking for a better way to use hiera hashes than create_resources

2014-04-28 Thread Alex Scoble
Hi Garrett,

Thanks for the response. The module you posted does indeed help as it shows 
how to deal with hashes of hiera data without using the create_resources() 
function.

Thanks,

Alex


>
> Hi, 
>
> The create_resources() function allows you to have a data driven design. 
> This gives you the ability to specify arbitrary data in Hiera and 
> decouple data from modules. It means you can change the data without the 
> code. I would argue that any define in your module should have a 
> corresponding create_resources() function, so that it can be accessed 
> through data in Hiera. 
>
> As for ordering, your defines should probably take care of that, though 
> you can use collections with chaining to help, such as 
>
>   Virt::Foo <||> -> Virt::Bar <||> 
>
> When you are using create_resources(), I recommend also specifying an 
> option to use hiera_hash() to collect your hashes. This does a deep hash 
> merge and will return values from all levels of the hierarchy. My types 
> module[1] is an example of this that lets you define file, mount, and 
> cron resources as hashes. 
>
> [1] - https://github.com/ghoneycutt/puppet-module-types 
>
> Best regards, 
> -g 
>
> -- 
> Garrett Honeycutt 
> @learnpuppet 
> Puppet Training with LearnPuppet.com 
> Mobile: +1.206.414.8658 
>

-- 
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/34d1eb41-71ee-4a5d-9258-49d3477dde13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Augeas Question

2014-04-28 Thread Pete Hartman
I hope this is an appropriate place for this question; if not, any 
redirection to a more appropriate place is appreciated.

So: I'm trying to set up puppet + augeas on an opensolaris system.  There 
are certain files I have that are under RCS version control--this is not 
all my doing, so some of these things I cannot change.  This creates files 
under /etc/ that are like "filename,v".

I'm using puppet 2.7.22 and augeas 1.0.0.

Well, augtool, and apparently augeas invoked via puppet throw up on this. 
 Augtool reports

Failed to initialize Augeas
error: Invalid path expression
error: garbage at end of path expression
/augeas/files/etc/default/nfs|=|,v

I just want augeas to ignore these files...

I think the answer is to modify the 
/usr/local/share/augeas/lenses/dist/*.aug files that refer to things that 
are causing this grief and add excl clauses to explicitly exclude anything 
*,v. 

For example in shellvars.aug we have

let filter_default = incl "/etc/default/*"
. excl "/etc/default/grub_installdevice*"
. excl "/etc/default/whoopsie"

I've added 
. excl "/etc/default/*,v"

This appears to work.  But I'm not sure this is the "right" solution -- 
should I perhaps be making a copy of this to somewhere else and override 
the dist version?  Is there a more global way I could say "ignore all files 
that have ,v after them" ?

Thanks

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/017535fd-ff18-48e5-83eb-50d5f35b1a9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Looking for a better way to use hiera hashes than create_resources

2014-04-28 Thread Garrett Honeycutt
On 4/28/14, 3:34 PM, Alex Scoble wrote:
> Hi All,
> 
> I'm working on a module that builds KVM/libvirt hosts and populates them
> with predefined VMs.
> 
> So far I have the module to where it can create any number of virtual
> nets, storage pools and volumes using virsh, but it isn't pretty.
> 
> I've read on various threads here that create_resources is not a good
> function to use. This was stated quite emphatically by R.I. Pienaar and
> others.
> 
> Already I've run into the situation where it's hard to control order in
> which two separate create_resources functions are run and I've seen some
> kludges to fix it, but I'm looking for a better way and hoping that it
> doesn't involve the use of custom types because that's currently more
> than I want to deal with.
> 
> Here's what I have and hopefully someone can help me do this in a
> cleaner way. Sorry that it's not in Github as I'm not ready to put it
> there yet.
> 
> *This is an example of the hiera data that I'm working with:*
> 
> kvm::servertype:'kvm'
> kvm::virtnet_name:'br0'
> kvm::virtnet_forwardmode:'bridge'
> kvm::virtbridge_name:'br0'
> kvm::virtnet_macaddress:'52:54:00:1F:95:6C'
> kvm::virtpool_hash:
>   default:
> virtpool_size:'429496729601'
>   iso-images:
> virtpool_target:'/var/lib/libvirt/iso-images'
> virtpool_format:'iso'
> kvm::virtvol_hash:
>   dtlrazorts1.img:
> volcapacity:'80G'
> volformat:'qcow2'
>   dtlrepots1.img:
> volcapacity:'80G'
> volformat:'qcow2'
>   dtlwebvirtmants1.img:
> volcapacity:'60G'
> volformat:'qcow2'
> 
> *My init.pp*
> 
> class kvm (
>   $servertype  = $kvm::params::servertype,
>   $virtnet_name= 'undef',
>   $virtnet_forwardmode = 'undef',
>   $virtbridge_name = 'undef',
>   $virtnet_macaddress  = 'undef',
>   $virtpool_hash   = 'undef',
>   $virtvol_hash= 'undef',
> ) inherits kvm::params {
> 
>   include kvm::fw
> 
>   if ($servertype == 'kvm') {
> 
> file { '/var/opt/lib/pe-puppet/temp':
>   ensure => directory,
>   owner  => 'pe-puppet',
>   group  => 'pe-puppet',  
> }
> 
> package { ['libvirt',
>'python-virtinst',
>'qemu-kvm',
>'qemu-kvm-tools',
>'bridge-utils',
>'virt-manager',
>'libguestfs-tools',]:
>   ensure => present,
> }
> 
> service { 'libvirtd':
>   ensure => running,
>   enable => true,
>   hasstatus  => true,
>   hasrestart => true,
>   require=> Package['libvirt'],
> }
> 
> if $virtpool_hash {
> create_resources('kvm::virtpool', $virtpool_hash)
> }
> include kvm::virtnet
> if $virtvol_hash {
> create_resources('kvm::virtvol', $virtvol_hash)
> }
>   }
> 
>   if $servertype == 'kvmwebmgr' {
> include kvm::kvmwebmgr
>   }
> 
> }
> 
> *The virtpool.pp file:*
> 
> define kvm::virtpool (
>   $virtpool= $name,
>   $virtpool_size   = undef,
>   $virtpool_target = '/var/lib/libvirt/images',
>   $virtpool_type   = 'dir',
>   $virtpool_format = 'raw',
> ) {
>   
>   file { "${virtpool_target}":
> ensure => directory,
>   } ->  
>   exec { "virsh pool-define-as ${name} --target ${virtpool_target}
> --type ${virtpool_type} --source-format ${virtpool_format} && virsh
> pool-autostart ${name} && virsh pool-start ${name}":
> path=> '/usr/bin',
> unless  => "virsh pool-list | /bin/grep ${name}",
> #refreshonly => true,
>   }
> 
> }
> 
> *The virtnet.pp file:*
> 
> class kvm::virtnet inherits kvm {
>   
>   file {
> "/var/opt/lib/pe-puppet/temp/${hostname}_virtnet_${virtnet_name}.xml":
> ensure  => file,
> content => template('kvm/virtnet.xml.erb'),
> owner   => 'pe-puppet',
> group   => 'pe-puppet',
>   } ->  
>   exec { 'virsh net-destroy default && virsh net-undefine default':
> path   => '/usr/bin',
> onlyif => 'virsh net-list | /bin/grep default',
>   } ->  
>   exec { "virsh net-define
> /var/opt/lib/pe-puppet/temp/${hostname}_virtnet_${virtnet_name}.xml &&
> virsh net-autostart ${virtnet_name} && virsh net-start ${virtnet_name}":
> path   => '/usr/bin',
> unless => "virsh net-list | /bin/grep ${virtnet_name}",
>   }
> 
> }
> 
> *The virtvol.pp file:*
> 
> define kvm::virtvol (
>   $virtvol = $name,
>   $pool= 'default',
>   $volcapacity = '60G',
>   $volformat   = 'qcow2',
> ) {
>   
>   exec { "virsh vol-create-as ${pool} ${name} ${volcapacity} --format
> ${volformat}":
> path   => '/usr/bin',
> unless => "virsh vol-list ${name} | /bin/grep ${name}",
> onlyif => "virsh pool-list ${pool} | /bin/grep ${pool}",
>   } 
>   
> }
> 
> *The virtnet.xml.erb:*
> 
> 
>   <%= @virtnet_name %>
>   
>   
>   
> 
> 
> -
> end files
> -
> 
> It would be super helpful if anyone

[Puppet Users] Re: Looking for a better way to use hiera hashes than create_resources

2014-04-28 Thread Alex Scoble
By the way, if it's not clear, my ultimate goal is to automate everything 
so that bare metal servers pxe boot to a razor server, get their CentOS 
install ISO and kickstart from razor, get installed, boot up, get their 
network interfaces and logical volumes set up, get all the necessary 
libvirt packages installed and configured, all the necessary bits required 
to get VMs up and running (storage pools, virtual volumes, virtual 
networks), VMs get spun up, they connect to razor and get their OSes 
installed and everything configured through Puppet.

And the only thing I have to do is turn on the bare metal servers and sign 
the puppet certs, although I will likely set the Puppet server to autosign 
those as well so everything is automated. This way we can have a set of lab 
systems that can be brought up and torn down as quickly as possible.

On Monday, April 28, 2014 12:34:43 PM UTC-7, Alex Scoble wrote:
>
> Hi All,
>
> I'm working on a module that builds KVM/libvirt hosts and populates them 
> with predefined VMs.
>
> So far I have the module to where it can create any number of virtual 
> nets, storage pools and volumes using virsh, but it isn't pretty.
>
> I've read on various threads here that create_resources is not a good 
> function to use. This was stated quite emphatically by R.I. Pienaar and 
> others.
>
> Already I've run into the situation where it's hard to control order in 
> which two separate create_resources functions are run and I've seen some 
> kludges to fix it, but I'm looking for a better way and hoping that it 
> doesn't involve the use of custom types because that's currently more than 
> I want to deal with.
>
> Here's what I have and hopefully someone can help me do this in a cleaner 
> way. Sorry that it's not in Github as I'm not ready to put it there yet.
>
> *This is an example of the hiera data that I'm working with:*
>
> kvm::servertype: 'kvm'
> kvm::virtnet_name: 'br0'
> kvm::virtnet_forwardmode: 'bridge'
> kvm::virtbridge_name: 'br0'
> kvm::virtnet_macaddress: '52:54:00:1F:95:6C'
> kvm::virtpool_hash:
>   default:
> virtpool_size: '429496729601'
>   iso-images:
> virtpool_target: '/var/lib/libvirt/iso-images'
> virtpool_format: 'iso'
> kvm::virtvol_hash:
>   dtlrazorts1.img:
> volcapacity: '80G'
> volformat: 'qcow2'
>   dtlrepots1.img:
> volcapacity: '80G'
> volformat: 'qcow2'
>   dtlwebvirtmants1.img:
> volcapacity: '60G'
> volformat: 'qcow2'
>
> *My init.pp*
>
> class kvm (
>   $servertype  = $kvm::params::servertype,
>   $virtnet_name= 'undef',
>   $virtnet_forwardmode = 'undef',
>   $virtbridge_name = 'undef',
>   $virtnet_macaddress  = 'undef',
>   $virtpool_hash   = 'undef',
>   $virtvol_hash= 'undef',
> ) inherits kvm::params {
>
>   include kvm::fw
>
>   if ($servertype == 'kvm') {
> 
> file { '/var/opt/lib/pe-puppet/temp':
>   ensure => directory,
>   owner  => 'pe-puppet',
>   group  => 'pe-puppet',  
> }
> 
> package { ['libvirt',
>'python-virtinst',
>'qemu-kvm',
>'qemu-kvm-tools',
>'bridge-utils',
>'virt-manager',
>'libguestfs-tools',]:
>   ensure => present,
> }
>
> service { 'libvirtd':
>   ensure => running,
>   enable => true,
>   hasstatus  => true,
>   hasrestart => true,
>   require=> Package['libvirt'],
> }
> 
> if $virtpool_hash {
> create_resources('kvm::virtpool', $virtpool_hash)
> }
> include kvm::virtnet
> if $virtvol_hash {
> create_resources('kvm::virtvol', $virtvol_hash)
> }
>   }
>
>   if $servertype == 'kvmwebmgr' {
> include kvm::kvmwebmgr
>   }
>
> }
>
> *The virtpool.pp file:*
>
> define kvm::virtpool (
>   $virtpool= $name,
>   $virtpool_size   = undef,
>   $virtpool_target = '/var/lib/libvirt/images',
>   $virtpool_type   = 'dir',
>   $virtpool_format = 'raw',
> ) {
>   
>   file { "${virtpool_target}":
> ensure => directory,
>   } ->  
>   exec { "virsh pool-define-as ${name} --target ${virtpool_target} --type 
> ${virtpool_type} --source-format ${virtpool_format} && virsh pool-autostart 
> ${name} && virsh pool-start ${name}":
> path=> '/usr/bin',
> unless  => "virsh pool-list | /bin/grep ${name}",
> #refreshonly => true,
>   }
> 
> }
>
> *The virtnet.pp file:*
>
> class kvm::virtnet inherits kvm {
>   
>   file { 
> "/var/opt/lib/pe-puppet/temp/${hostname}_virtnet_${virtnet_name}.xml":
> ensure  => file,
> content => template('kvm/virtnet.xml.erb'),
> owner   => 'pe-puppet',
> group   => 'pe-puppet',
>   } ->  
>   exec { 'virsh net-destroy default && virsh net-undefine default':
> path   => '/usr/bin',
> onlyif => 'virsh net-list | /bin/grep default',
>   } ->  
>   exec { "virsh net-define 
> /var/opt/lib/pe-puppet/temp/${hostname}_virtnet_${virtnet_name}.xml && 
> virsh net-autostart

[Puppet Users] Looking for a better way to use hiera hashes than create_resources

2014-04-28 Thread Alex Scoble
Hi All,

I'm working on a module that builds KVM/libvirt hosts and populates them 
with predefined VMs.

So far I have the module to where it can create any number of virtual nets, 
storage pools and volumes using virsh, but it isn't pretty.

I've read on various threads here that create_resources is not a good 
function to use. This was stated quite emphatically by R.I. Pienaar and 
others.

Already I've run into the situation where it's hard to control order in 
which two separate create_resources functions are run and I've seen some 
kludges to fix it, but I'm looking for a better way and hoping that it 
doesn't involve the use of custom types because that's currently more than 
I want to deal with.

Here's what I have and hopefully someone can help me do this in a cleaner 
way. Sorry that it's not in Github as I'm not ready to put it there yet.

*This is an example of the hiera data that I'm working with:*

kvm::servertype: 'kvm'
kvm::virtnet_name: 'br0'
kvm::virtnet_forwardmode: 'bridge'
kvm::virtbridge_name: 'br0'
kvm::virtnet_macaddress: '52:54:00:1F:95:6C'
kvm::virtpool_hash:
  default:
virtpool_size: '429496729601'
  iso-images:
virtpool_target: '/var/lib/libvirt/iso-images'
virtpool_format: 'iso'
kvm::virtvol_hash:
  dtlrazorts1.img:
volcapacity: '80G'
volformat: 'qcow2'
  dtlrepots1.img:
volcapacity: '80G'
volformat: 'qcow2'
  dtlwebvirtmants1.img:
volcapacity: '60G'
volformat: 'qcow2'

*My init.pp*

class kvm (
  $servertype  = $kvm::params::servertype,
  $virtnet_name= 'undef',
  $virtnet_forwardmode = 'undef',
  $virtbridge_name = 'undef',
  $virtnet_macaddress  = 'undef',
  $virtpool_hash   = 'undef',
  $virtvol_hash= 'undef',
) inherits kvm::params {

  include kvm::fw

  if ($servertype == 'kvm') {

file { '/var/opt/lib/pe-puppet/temp':
  ensure => directory,
  owner  => 'pe-puppet',
  group  => 'pe-puppet',  
}

package { ['libvirt',
   'python-virtinst',
   'qemu-kvm',
   'qemu-kvm-tools',
   'bridge-utils',
   'virt-manager',
   'libguestfs-tools',]:
  ensure => present,
}

service { 'libvirtd':
  ensure => running,
  enable => true,
  hasstatus  => true,
  hasrestart => true,
  require=> Package['libvirt'],
}

if $virtpool_hash {
create_resources('kvm::virtpool', $virtpool_hash)
}
include kvm::virtnet
if $virtvol_hash {
create_resources('kvm::virtvol', $virtvol_hash)
}
  }

  if $servertype == 'kvmwebmgr' {
include kvm::kvmwebmgr
  }

}

*The virtpool.pp file:*

define kvm::virtpool (
  $virtpool= $name,
  $virtpool_size   = undef,
  $virtpool_target = '/var/lib/libvirt/images',
  $virtpool_type   = 'dir',
  $virtpool_format = 'raw',
) {
  
  file { "${virtpool_target}":
ensure => directory,
  } ->  
  exec { "virsh pool-define-as ${name} --target ${virtpool_target} --type 
${virtpool_type} --source-format ${virtpool_format} && virsh pool-autostart 
${name} && virsh pool-start ${name}":
path=> '/usr/bin',
unless  => "virsh pool-list | /bin/grep ${name}",
#refreshonly => true,
  }

}

*The virtnet.pp file:*

class kvm::virtnet inherits kvm {
  
  file { 
"/var/opt/lib/pe-puppet/temp/${hostname}_virtnet_${virtnet_name}.xml":
ensure  => file,
content => template('kvm/virtnet.xml.erb'),
owner   => 'pe-puppet',
group   => 'pe-puppet',
  } ->  
  exec { 'virsh net-destroy default && virsh net-undefine default':
path   => '/usr/bin',
onlyif => 'virsh net-list | /bin/grep default',
  } ->  
  exec { "virsh net-define 
/var/opt/lib/pe-puppet/temp/${hostname}_virtnet_${virtnet_name}.xml && 
virsh net-autostart ${virtnet_name} && virsh net-start ${virtnet_name}":
path   => '/usr/bin',
unless => "virsh net-list | /bin/grep ${virtnet_name}",
  }

}

*The virtvol.pp file:*

define kvm::virtvol (
  $virtvol = $name,
  $pool= 'default',
  $volcapacity = '60G',
  $volformat   = 'qcow2',
) {
  
  exec { "virsh vol-create-as ${pool} ${name} ${volcapacity} --format 
${volformat}":
path   => '/usr/bin',
unless => "virsh vol-list ${name} | /bin/grep ${name}",
onlyif => "virsh pool-list ${pool} | /bin/grep ${pool}",
  } 
  
}

*The virtnet.xml.erb:*


  <%= @virtnet_name %>
  
  
  


-
end files
-

It would be super helpful if anyone could point me to a puppet module on 
github that presents me with a better pattern to use with the hiera data.

Any other help or criticisms are also welcome.

Thanks,

Alex




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

Re: [Puppet Users] facter for debian: missing '_all.deb' version

2014-04-28 Thread Matthaus Owens
This issue is being tracked at
https://tickets.puppetlabs.com/browse/CPR-5. The core of the problem
is that facter is not an all arch package. It depends on dmidecode,
which is not available for all architectures. Because of this, facter
is an arch dependent package and there is no all package for it. There
is more detail in the linked ticket.

HTH

On Mon, Apr 28, 2014 at 7:52 AM, JonY  wrote:
> To the build-czars at puppet labs: could you please include a "*_all.deb"
> version of facter in your build cycle? It doesn't appear to have been
> created since v 1.6.18.
>
> My clients are almost exclusively ARM based and can't upgrade without this
> being available.
>
> Humbly yours, me.
>
> --
> 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/d01e58d1-70a1-47ae-b802-d49473d2d5b0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Matthaus Owens
Puppet Labs

Join us at PuppetConf 2014, September 22-24 in San Francisco
Register by May 30th to take advantage of the Early Adopter discount —save $349!

-- 
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%3DwAfekHn0thnJtAx1XMK3xjS6Gt5CdNjqX-%2BJ4atcRtZwZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet apply stops with message "Killed"

2014-04-28 Thread Juan Sierra Pons
2014-04-28 17:50 GMT+02:00 Ádám Sándor :
> Viewing the process tree doesn't show anything new, it doesn't look like
> puppet is forking any new processes. It's just using more and more memory
> and 94% of CPU. This happens even if I run the provisioning after everything
> is set up so it doesn't even have to do much.
>
> Something I left out from my original post is that I'm running in a vserver
> environment. When I tried to replicate that environment locally in my
> vagrant box by disabling swap space and setting memory to 512MB puppet
> didn't have a problem, so this could be vserver related. Does anyone have a
> similar experience?
>
> On Monday, April 28, 2014 4:14:45 PM UTC+2, Ádám Sándor wrote:
>>
>> Thanks for the reply. It seems that the Killed message is coming from the
>> vserver manager (or whatever it's called, I don't know much about the
>> technology), because the process is using too much memory. Which is a
>> problem because it means that puppet is using more memory then the
>> application actually needs. I'll look into it more closely and try the stuff
>> you posted see what that shows.
>>
>> On Friday, April 25, 2014 2:38:18 PM UTC+2, Felix.Frank wrote:
>>>
>>> Hi,
>>>
>>> can you find out wether that is reproducible with Puppet 3.4? If not,
>>> you may just want to hold out for 3.6, wait if it works better.
>>>
>>> For debugging this, I would try two things.
>>>
>>> First, keep an eye on 'ps auxwf' output while puppet is seemingly
>>> frozen, see wether and what is being forked.
>>>
>>> If that doesn't help, you can try with `strace -f`, although there's a
>>> fair chance that it won't yield very conclusive traces.
>>>
>>> HTH,
>>> Felix
>>>
>>> On 04/21/2014 12:01 PM, Ádám Sándor wrote:
>>> > Hi,
>>> >
>>> > I'm having a problem with my puppet script hanging for a while then
>>> > dying with the message "Killed" printed to the console. There is no
>>> > further explanation of what happened but I'm suspecting some event
>>> > propagation might get stuck and puppet may have some mechanism to kill
>>> > the process if it hangs for too long. That's just a guess though, so
>>> > please let me know if anyone has some insight on this problem. Thanks!
>>> >
>>> > I'm running on Debian 7, Puppet 3.5.1.
>>> > Tail of the output of "puppet apply --verbose --debug
>>> > --modulepath=/root/puppet/modules /root/puppet/ks-prod.pp" is:
>
> --
> 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/e4ebdcdc-4bc2-46d0-8e79-24370336ba17%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Hi,

I had a similar problem with another software and the reponsible of
killing the process was the "Out-of-Memory Process Killer"

Probably your server has not enough memory and no swap and when the
puppet process runs the Out-of-Memory Process Killer kills it.

Solutions /workarounds:

Add some swap to the server
Add some memory

Hope it helps

Best regards

--
Juan Sierra Pons j...@elsotanillo.net
Linux User Registered: #257202
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--

-- 
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/CABS%3Dy9vh1wo5cZ08a%3DmtBbw0EQc%3DCqCDOqA5yRF93-C%2BVhsd3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet apply stops with message "Killed"

2014-04-28 Thread Ádám Sándor
Viewing the process tree doesn't show anything new, it doesn't look like 
puppet is forking any new processes. It's just using more and more memory 
and 94% of CPU. This happens even if I run the provisioning after 
everything is set up so it doesn't even have to do much.

Something I left out from my original post is that I'm running in a vserver 
environment. When I tried to replicate that environment locally in my 
vagrant box by disabling swap space and setting memory to 512MB puppet 
didn't have a problem, so this could be vserver related. Does anyone have a 
similar experience?

On Monday, April 28, 2014 4:14:45 PM UTC+2, Ádám Sándor wrote:
>
> Thanks for the reply. It seems that the Killed message is coming from the 
> vserver manager (or whatever it's called, I don't know much about the 
> technology), because the process is using too much memory. Which is a 
> problem because it means that puppet is using more memory then the 
> application actually needs. I'll look into it more closely and try the 
> stuff you posted see what that shows.
>
> On Friday, April 25, 2014 2:38:18 PM UTC+2, Felix.Frank wrote:
>>
>> Hi, 
>>
>> can you find out wether that is reproducible with Puppet 3.4? If not, 
>> you may just want to hold out for 3.6, wait if it works better. 
>>
>> For debugging this, I would try two things. 
>>
>> First, keep an eye on 'ps auxwf' output while puppet is seemingly 
>> frozen, see wether and what is being forked. 
>>
>> If that doesn't help, you can try with `strace -f`, although there's a 
>> fair chance that it won't yield very conclusive traces. 
>>
>> HTH, 
>> Felix 
>>
>> On 04/21/2014 12:01 PM, Ádám Sándor wrote: 
>> > Hi, 
>> > 
>> > I'm having a problem with my puppet script hanging for a while then 
>> > dying with the message "Killed" printed to the console. There is no 
>> > further explanation of what happened but I'm suspecting some event 
>> > propagation might get stuck and puppet may have some mechanism to kill 
>> > the process if it hangs for too long. That's just a guess though, so 
>> > please let me know if anyone has some insight on this problem. Thanks! 
>> > 
>> > I'm running on Debian 7, Puppet 3.5.1. 
>> > Tail of the output of "puppet apply --verbose --debug 
>> > --modulepath=/root/puppet/modules /root/puppet/ks-prod.pp" is: 
>>
>

-- 
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/e4ebdcdc-4bc2-46d0-8e79-24370336ba17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] facter for debian: missing '_all.deb' version

2014-04-28 Thread JonY
To the build-czars at puppet labs: could you please include a "*_all.deb" 
version of facter in your build cycle? It doesn't appear to have been 
created since v 1.6.18. 

My clients are almost exclusively ARM based and can't upgrade without this 
being available.

Humbly yours, me.

-- 
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/d01e58d1-70a1-47ae-b802-d49473d2d5b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetDB intermittent crashing

2014-04-28 Thread Ken Barber
>>> I don't really know much about the internals of PuppetDB, so can anyone
>>> shed
>>> any light on the possible cause of these crashes, and what I can do to
>>> mitigate them?
>>
>> I'd be interested to see what is happening your postgresql.log when
>> this occurs. Connections must be closing for some specific reason, and
>> I'd hope that the postgresql instance can shed some light on this.
>
> I don't run the Postgresql server so access to the logs might take some time
> (the guy who used to run it has now left...)

That is disconcerting, I think we need to see those however, since the
client in this case is dumb to the issue, all it sees is a connection
that has been closed underneath it for some reason.

>> You're not trying to connect to the database through a firewall,
>> load-balancer or some other device are you? Even if the device is "in
>> the way" but meant to be passive, I've still seen issues (especially
>> with F5's or checkpoint firewalls that were badly configured).
>
>
> The Puppetmaster and the Postgresql server are on different subnets but are
> not firewalled from each other. No crazy load-balancing here (yet).

Well still, I don't know your setup and unless your run the devices in
the path - you can never ever be sure.

>>> # puppetdb.log
>>>
>>> 2014-04-28 09:46:39,535 ERROR [clojure-agent-send-off-pool-15]
>>> [http.resources] Error streaming response
>>> org.postgresql.util.PSQLException: This connection has been closed.
>>> at
>>> org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:822)
>>> at
>>> org.postgresql.jdbc2.AbstractJdbc2Connection.setAutoCommit(AbstractJdbc2Connection.java:769)
>>> at
>>> com.jolbox.bonecp.ConnectionHandle.setAutoCommit(ConnectionHandle.java:1063)
>>> at
>>> clojure.java.jdbc.internal$transaction_STAR_.invoke(internal.clj:222)
>>> at
>>> com.puppetlabs.jdbc$with_transacted_connection_fn$fn__2278.invoke(jdbc.clj:228)
>>> at
>>> clojure.java.jdbc.internal$with_connection_STAR_.invoke(internal.clj:186)
>>> at
>>> com.puppetlabs.jdbc$with_transacted_connection_fn.invoke(jdbc.clj:225)
>>> at
>>> com.puppetlabs.puppetdb.http.resources$produce_body$fn__7017$fn__7020.invoke(resources.clj:36)
>>> at ring.util.io$piped_input_stream$fn__2512.invoke(io.clj:22)
>>> at
>>> clojure.core$binding_conveyor_fn$fn__4107.invoke(core.clj:1836)
>>> at clojure.lang.AFn.call(AFn.java:18)
>>> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>> at java.lang.Thread.run(Thread.java:744)
>>
>> Not much detail from the JDBC postgresql client really, looks like a
>> connection that we have retrieved from the pool was already closed.
>> This didn't seem to happen during an actual transaction because I can
>> see the attempt to disable autoCommit has triggered the exception,
>> which is something we normally do very early in a transaction.
>>
>> This is synonymous with database connections being timed out, often
>> caused by network devices or some other timeout policy.
>
> As I mentioned, the Puppetmaster/PuppetDB and the Postgresql server on
> different subnets. However access between the two servers happens several
> times a minute as there are so many nodes. Timeout due to inactivity seems
> very unlikely.

Well, while I believe the connection pooling software should be
round-robining all its available connections there is a possibility
that an older stale connection was retrieved. I guess the fact this is
restarting every 30 minutes makes this unlikely.

Regardless, I'd recommend adjusting the keepalive setting to something
aggressive like 1 minute and see what happens. The very fact they live
on different subnets means that traffic is passing through a router of
some kind, and even routers can do strange things to packets.

At the very least it will rule out connection timeouts.

>> Is this the only exception thrown btw? Anything else? Can you show us
>> the rest of the log _around_ the exception?
>
> Attached today's puppetdb.log. There are several instances of the same error
> but other than that, everything seems normal.

Yeah, nothing obviously new to learn from this :-(. At least not yet anyway.

We need to see the other end and what it is doing to connections. This
means checking the postgresql logs and perhaps bumping the log levels
to see if its the PG end dropping the connection (and maybe we can get
a reason ...).

Another idea is to remove the network completely from the equation and
try running a local PG instance on the puppetdb server for a period of
time, this would prove/disprove quite a lot and is probably a good
next step if the PG logging surfaces no new information.

After that I would usually drop to doing a proper ne

Re: [Puppet Users] puppet apply stops with message "Killed"

2014-04-28 Thread Ádám Sándor
Thanks for the reply. It seems that the Killed message is coming from the 
vserver manager (or whatever it's called, I don't know much about the 
technology), because the process is using too much memory. Which is a 
problem because it means that puppet is using more memory then the 
application actually needs. I'll look into it more closely and try the 
stuff you posted see what that shows.

On Friday, April 25, 2014 2:38:18 PM UTC+2, Felix.Frank wrote:
>
> Hi, 
>
> can you find out wether that is reproducible with Puppet 3.4? If not, 
> you may just want to hold out for 3.6, wait if it works better. 
>
> For debugging this, I would try two things. 
>
> First, keep an eye on 'ps auxwf' output while puppet is seemingly 
> frozen, see wether and what is being forked. 
>
> If that doesn't help, you can try with `strace -f`, although there's a 
> fair chance that it won't yield very conclusive traces. 
>
> HTH, 
> Felix 
>
> On 04/21/2014 12:01 PM, Ádám Sándor wrote: 
> > Hi, 
> > 
> > I'm having a problem with my puppet script hanging for a while then 
> > dying with the message "Killed" printed to the console. There is no 
> > further explanation of what happened but I'm suspecting some event 
> > propagation might get stuck and puppet may have some mechanism to kill 
> > the process if it hangs for too long. That's just a guess though, so 
> > please let me know if anyone has some insight on this problem. Thanks! 
> > 
> > I'm running on Debian 7, Puppet 3.5.1. 
> > Tail of the output of "puppet apply --verbose --debug 
> > --modulepath=/root/puppet/modules /root/puppet/ks-prod.pp" is: 
>

-- 
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/b7898b9e-24d3-4cea-9c31-8276bdce4675%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: rspec-puppet: how to pass undef as parameter value?

2014-04-28 Thread jcbollinger


On Sunday, April 27, 2014 9:38:52 AM UTC-5, Remi Ferrand wrote:
>
> Hi everyone,
>
> thanks all for your answers but i'm starting to think that there is way to 
> pass puppet "undef" value from a rspec test...
> If anybody has the solution to fix this test suite (
> https://github.com/riton/puppetrspec) please tell me; otherwise I'll have 
> to rewrite my manifests and replace the puppet "undef" value with a simple 
> "undef" string where it is possible...
>
> It doesn't have the same meaning but it can help me moving on with my test 
> suite.
>
>

I've been watching this thread with interest because people were offering 
actual approaches to do something that I would not have thought was 
possible.  I'll be a bit disappointed if it indeed turns out that it really 
isn't possible.

To the best of my knowledge, however, Puppet never passes undef as the 
value of a class or resource parameter.  At least, if you assign undef to a 
class or resource parameter in the DSL, then that does not mean the 
parameter should take that value; rather, it is an affirmative expression 
of not assigning any value at all.  As a result, the parameter takes the 
default value defined for it, if there is any.  (That's most often useful 
in the form of an override.)

If you could use rspec to assign undef as a class or resource parameter, 
then what would that actually test?  Not any defined behavior of your class 
or type.  If it is Puppet's DSL evaluator that strips undef-valued 
parameters, then bypassing that via rspec -- if you can -- must yield 
undefined behavior.  On the other hand, if it is a general feature of 
Puppet's infrastructure for types that strips undef-valued parameters, then 
sending undef via rspec tests that feature, not anything your type can do.

I would have thought that the way to test what your type does when one of 
its parameter is declared undef would be simply to avoid specifying that 
parameter to it.


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/0467cb05-4125-4760-8fa7-48bebdfc8dd8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to perform in puppet: service start - mod config - service restart

2014-04-28 Thread Josh Cooper
On Sunday, April 27, 2014, Lito K  wrote:

> Hi everyone,
> I have the following scenario:
> I have an app.war file that needs to be expanded in tomcat, this war file
> creates a new directory at /app/{data,config,profile}.
> I need to change a file in /app/config/server.properties after the war
> expansion.
> I need to restart tomcat to refresh the config update.
>
> I tried this sequence:
> copy app.war in webapps
> run tomcat, the war expanded
> change config
> refresh tomcat
>
> In puppet, it becomes:
>
> file {"/tmp/app.war":
>   ensure => "present",
>   path => "/tomcat/webapps/app.war",
>   owner => "tomcat",
>   group => "tomcat",
>   before => Service["tomcat"],
> }
>
> service { "tomcat":
>   ensure => "running",
>   enable => true,
>   subscribe => File["/app/config/server.properties"],
> }
>
> file {"/app/config/server.properties":
>   ensure => "present",
>   source => "/tmp/newconfig/server.properties",
>   owner => "tomcat",
>   group => "tomcat",
>   notify => Service["tomcat"],
> }
>
>
You'll want either the subscribe or notify relationship between the service
and file, but not both as that creates a dependency cycle.

I keep getting this error:
>
>  *err: Could not apply complete catalog: Found 1 dependency cycle:*
>
> *(File[/app/config/server.properties] => Service[tomcat] =>
> File[/app/config/server.properties])*
>
> *Cycle graph written to /var/lib/puppet/state/graphs/cycles.dot.*
> I was wondering if someone can give me a hint how to solve this dependency
> cycle issue.
>
> My understanding:
> Tomcat subscribes to config file (meaning it will be refreshed if there's
> a change in the config file)
> The config file change, then it notifies tomcat.
> Tomcat picks up the notification, it then refreshes.
> I don't see where the cycle happens???
>
> I am fairly new to puppet, so any explanation would help.
>
> Many thanks.
>
> Puppet client: 2.7.25-2 (from EPEL, latest for CENTOS 6)
> OS: Redhat 6.4 64bit
>
>
>  --
> 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/65db7123-65ab-4350-b862-f68ebd7f4d0a%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

Josh


-- 
Josh Cooper
Developer, Puppet Labs

*Join us at PuppetConf 2014 , September
22-24 in San Francisco*
*Register by May 30th to take advantage of the Early Adopter discount
 **—**save $349!*

-- 
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%2Bu97u%3DaeX2_%2BJmuqpgb1CyWfd_GL1qd-RyEDy78dCO5fBfSDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Error 400 on Server: 0 is not a string. It looks to be a Fixnum on node example.test.net

2014-04-28 Thread Ken Barber
Can you paste the full error in a gist (with surrounding content as
well) instead of just putting it in a subject line?

If you can run the failing component with --debug so we can see more
verbose output next to the error that might be also useful. If this
error is being logged by your master, you should run the master using
--no-daemonize and --debug perhaps.

ken.

On Mon, Apr 28, 2014 at 3:38 AM, Tony Zhao  wrote:
> This is the error I got running puppetlab's puppetdb module trying to setup
> puppetdb and postgresql. I was able to run it locally with puppet apply.
>
> I am running puppet 3.5.1 on both master and agent with hiera. Master is
> running Apache+Passenger.
>
> Has anyone encounter similar issue before and can provide some insights?
>
> --
> 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/461d498b-22d6-4b39-bc44-1e4d94a1e75b%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/CAE4bNTkgq3RP98%3DY8uCmQ4w44h71M_0dE%3D8CSzj_xmaGJNXOSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] A file managed by puppet that is left alone if customized

2014-04-28 Thread Len Rugen
Look at the creates => option, I use that to drop an initial /etc/my.cnf,
but then it can be modified and not regressed by puppet.


On Mon, Apr 28, 2014 at 3:41 AM, Paul Tötterman wrote:

> For files in user's home directories I would manage the skeleton files
>> using puppet and then when the user account is created they'll be copied
>> into their home directory. That obviously only works for new users though.
>> It won't account for existing users or for updating the file if it hasn't
>> been touched by the user yet.
>>
>
> $dir is in home just to make this easily testable using puppet apply. The
> files I'm planning to manage are in /etc and users have sudo rights.
>
> /etc/skel is clearly the right way to handle initial home directory files.
>
> 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/208cbf21-c3e8-45fe-99ee-5b4ab7e598fe%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/CAEx7SAx1JRyiZozXaj2C%3D_iM_Q1wpHnYDe84-8DkVOZ%3DChkmOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetDB intermittent crashing

2014-04-28 Thread Ken Barber
> I'm using Puppet with PuppetDB running on the same machine, but with the
> Postgresql database on an external server. Several times a day, PuppetDB
> seems to crash with errors like the one below. Nodes are then unable to
> check in, although Puppet will restart its own PuppetDB service on its
> 30-minute runs so the problem sort of fixes itself after a bit.

Are you doing this to workaround this issue or for other reasons? Just
seems a bit weird to do during normal operation.

> I don't really know much about the internals of PuppetDB, so can anyone shed
> any light on the possible cause of these crashes, and what I can do to
> mitigate them?

I'd be interested to see what is happening your postgresql.log when
this occurs. Connections must be closing for some specific reason, and
I'd hope that the postgresql instance can shed some light on this.

You're not trying to connect to the database through a firewall,
load-balancer or some other device are you? Even if the device is "in
the way" but meant to be passive, I've still seen issues (especially
with F5's or checkpoint firewalls that were badly configured).

> # puppetdb.log
>
> 2014-04-28 09:46:39,535 ERROR [clojure-agent-send-off-pool-15]
> [http.resources] Error streaming response
> org.postgresql.util.PSQLException: This connection has been closed.
>at 
> org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:822)
>at 
> org.postgresql.jdbc2.AbstractJdbc2Connection.setAutoCommit(AbstractJdbc2Connection.java:769)
>at 
> com.jolbox.bonecp.ConnectionHandle.setAutoCommit(ConnectionHandle.java:1063)
>at 
> clojure.java.jdbc.internal$transaction_STAR_.invoke(internal.clj:222)
>at 
> com.puppetlabs.jdbc$with_transacted_connection_fn$fn__2278.invoke(jdbc.clj:228)
>at 
> clojure.java.jdbc.internal$with_connection_STAR_.invoke(internal.clj:186)
>at 
> com.puppetlabs.jdbc$with_transacted_connection_fn.invoke(jdbc.clj:225)
>at 
> com.puppetlabs.puppetdb.http.resources$produce_body$fn__7017$fn__7020.invoke(resources.clj:36)
>at ring.util.io$piped_input_stream$fn__2512.invoke(io.clj:22)
>at clojure.core$binding_conveyor_fn$fn__4107.invoke(core.clj:1836)
>at clojure.lang.AFn.call(AFn.java:18)
>at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>at java.lang.Thread.run(Thread.java:744)

Not much detail from the JDBC postgresql client really, looks like a
connection that we have retrieved from the pool was already closed.
This didn't seem to happen during an actual transaction because I can
see the attempt to disable autoCommit has triggered the exception,
which is something we normally do very early in a transaction.

This is synonymous with database connections being timed out, often
caused by network devices or some other timeout policy.

There is a setting here where we can adjust the keep alive interval:
http://docs.puppetlabs.com/puppetdb/master/configure.html#conn-keep-alive.
We default it to 45 minutes for 1.6.3 (you are running the latest
PuppetDB right?) ... but some firewalls and devices can have a shorter
TTL, like 30 minutes ... I've even seen as little as 5 minutes in
aggressively configured devices. For kicks you might want to set this
relatively low for a period of time to see if you get any
improvements. This might not be the actual problem however, there are
other timeouts that might cause this but its the most obscure fault to
track down so probably worth testing early.

Again I'd be curious to see what the Postgresql server says about
this. We might need to bump up the logging though to get anything we
can use.

Is this the only exception thrown btw? Anything else? Can you show us
the rest of the log _around_ the exception?

Can you show us the results of a 'show all' on the database as well?
Like I've done here:

[ken@kb puppetdb]# psql puppetdb
psql (9.3.4)
Type "help" for help.

puppetdb=# show all;
name |
setting  |
 description
-+--+---
 allow_system_table_mods | off
 | Allows
modifications of the structure of system tables.
 application_name| psql
 | Sets the
application name to be reported in statistics and logs.
 archive_command | (disabled)
 | Sets the shell
command that will

Re: [Puppet Users] Re: PuppetDB is crashing - db constraint issue

2014-04-28 Thread Ken Barber
Sorry, its your agents that need to be upgraded not your master. Are
they all running 3.4.3 or greater?

On Sat, Apr 26, 2014 at 7:08 PM, JonY  wrote:
>
>
> On Saturday, April 26, 2014 11:05:50 AM UTC-7, JonY wrote:
>>
>> I think I'm past that version already:
>>
>> # rpm -qa | grep puppet
>> puppetdb-1.6.3-1.el6.noarch
>> puppet-3.5.1-1.el6.noarch
>> puppet-server-3.5.1-1.el6.noarch
>> vim-puppet-2.7.20-1.el6.rf.noarch
>> puppetlabs-release-6-10.noarch
>> puppetdb-terminus-1.6.3-1.el6.noarch
>>
>>>
>
> NOTE: I'm not using postgresql either. Still under 100 clients...
>
> --
> 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/20353bc8-d1a2-42fa-8028-7adbd91e5fe4%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/CAE4bNT%3D6nANXEM23oiGOM%2Bux-ymLLgdedLwE2CxYdN-TC175GQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] how to perform in puppet: service start - mod config - service restart

2014-04-28 Thread Lito K
Hi everyone,
I have the following scenario:
I have an app.war file that needs to be expanded in tomcat, this war file 
creates a new directory at /app/{data,config,profile}.
I need to change a file in /app/config/server.properties after the war 
expansion.
I need to restart tomcat to refresh the config update.

I tried this sequence:
copy app.war in webapps
run tomcat, the war expanded
change config
refresh tomcat

In puppet, it becomes:

file {"/tmp/app.war":
  ensure => "present",
  path => "/tomcat/webapps/app.war",
  owner => "tomcat",
  group => "tomcat",
  before => Service["tomcat"],
}

service { "tomcat":
  ensure => "running",
  enable => true,
  subscribe => File["/app/config/server.properties"],
}

file {"/app/config/server.properties":
  ensure => "present",
  source => "/tmp/newconfig/server.properties",
  owner => "tomcat",
  group => "tomcat",
  notify => Service["tomcat"],
}

I keep getting this error:

 *err: Could not apply complete catalog: Found 1 dependency cycle:*

*(File[/app/config/server.properties] => Service[tomcat] => 
File[/app/config/server.properties])*

*Cycle graph written to /var/lib/puppet/state/graphs/cycles.dot.*
I was wondering if someone can give me a hint how to solve this dependency 
cycle issue.

My understanding:
Tomcat subscribes to config file (meaning it will be refreshed if there's a 
change in the config file)
The config file change, then it notifies tomcat.
Tomcat picks up the notification, it then refreshes.
I don't see where the cycle happens???

I am fairly new to puppet, so any explanation would help.

Many thanks.

Puppet client: 2.7.25-2 (from EPEL, latest for CENTOS 6)
OS: Redhat 6.4 64bit


-- 
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/65db7123-65ab-4350-b862-f68ebd7f4d0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] PuppetDB intermittent crashing

2014-04-28 Thread Jonathan Gazeley

Hi folks,

I'm using Puppet with PuppetDB running on the same machine, but with the 
Postgresql database on an external server. Several times a day, PuppetDB 
seems to crash with errors like the one below. Nodes are then unable to 
check in, although Puppet will restart its own PuppetDB service on its 
30-minute runs so the problem sort of fixes itself after a bit.


I don't really know much about the internals of PuppetDB, so can anyone 
shed any light on the possible cause of these crashes, and what I can do 
to mitigate them?


Thanks,
Jonathan

# puppetdb.log

2014-04-28 09:46:39,535 ERROR [clojure-agent-send-off-pool-15] 
[http.resources] Error streaming response

org.postgresql.util.PSQLException: This connection has been closed.
at 
org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:822)
at 
org.postgresql.jdbc2.AbstractJdbc2Connection.setAutoCommit(AbstractJdbc2Connection.java:769)
at 
com.jolbox.bonecp.ConnectionHandle.setAutoCommit(ConnectionHandle.java:1063)
at 
clojure.java.jdbc.internal$transaction_STAR_.invoke(internal.clj:222)
at 
com.puppetlabs.jdbc$with_transacted_connection_fn$fn__2278.invoke(jdbc.clj:228)
at 
clojure.java.jdbc.internal$with_connection_STAR_.invoke(internal.clj:186)
at 
com.puppetlabs.jdbc$with_transacted_connection_fn.invoke(jdbc.clj:225)
at 
com.puppetlabs.puppetdb.http.resources$produce_body$fn__7017$fn__7020.invoke(resources.clj:36)

at ring.util.io$piped_input_stream$fn__2512.invoke(io.clj:22)
at clojure.core$binding_conveyor_fn$fn__4107.invoke(core.clj:1836)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:744)

--
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/535E3667.7000700%40bristol.ac.uk.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Installed Puppet, installed Razor module but /etc/puppet/modules/razer/test directory missing?

2014-04-28 Thread Felix Frank
Hi,

On 04/26/2014 07:41 PM, Schorschi Decker wrote:
> 
> Actually looking at that page and other examples via Google is what
> suggested the 'test' directory should exist.  There seems to be a quite
> a few examples of how to install razor that all point to the same step,
> that does not appear to be correct.

I see. Those are likely outdated then.

> Since I am running Ubuntu 14.04? 
> Looks like the manifests class to validate Linux distrubution is not yet
> updated?  See the following...
> 
> https://github.com/puppetlabs/puppetlabs-razor/blob/master/manifests/libarchive.pp

Yes, absolutely (btw, easy syntax highlighting is available like this -
https://github.com/puppetlabs/puppetlabs-razor/blob/master/manifests/libarchive.pp#L3-7
:-)

So you can either wait until upstream fixes their module (boring, may
also not happen ;-) or you try your hand at fixing it and open a Pull
Request. Those are most appreciated.

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/535E19D5.2050006%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Best practice for creating resources out of Hiera?

2014-04-28 Thread Felix Frank
Hi,

this is really, really meta (http://xkcd.com/917/).

I'm a little cautious of building something like this:
http://thedailywtf.com/Articles/The_Enterprise_Rules_Engine.aspx

I'd have to play with your module though in order to get a feel about
wether it is rather useful or over the top.

One remark about your README - it's true that the adoption of functions
is not mentioned in the current documentation, but please note that you
can trace past documentations and easily bisect the origin of any
specific feature:

http://docs.puppetlabs.com/references/3.2.2/function.html
http://docs.puppetlabs.com/references/2.7.20/function.html
etc.

Also, git. :-)

Cheers,
Felix

On 04/27/2014 03:25 PM, John Morton wrote:
> I made a module called resource_factory:
> 
> https://forge.puppetlabs.com/jaydub/resource_factory
> 
> It has two parts. One is the resource_factory class, the other is the
> defined_resource_factory resource type. They both do the same kind of
> thing — wrap around create_resources with a hiera look up on some key.
> The difference is that the class creates defined_resource_factory
> instances by default, and those instances are where you put the resource
> types and hiera keys for the stuff you really want to create.
> Everything's configured in hiera without a lot of site specific classes.
> 
> Question is: have I just reinvented the wheel on some existing best
> practice, and if so, how are the grown ups creating resources out of Hiera?
> 
> 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/535E1782.6040508%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: A file managed by puppet that is left alone if customized

2014-04-28 Thread Paul Tötterman
I actually just had a revelation and thought of a better way:

$dir = inline_template('<%=ENV["HOME"]%>') # again, just to make testing 
> using puppet apply easier
> file { "$dir/foo":
> source => ["file://$dir/foo.local", 'file:///etc/motd']  # the latter 
> would typically be a puppet:/// URL
> }


In case the user wishes to make local modifications that are kept, he needs 
to `ln foo foo.local` and puppet won't copy from the canonical source.

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/0346f8d1-a2f0-401d-9847-05f425d656fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] A file managed by puppet that is left alone if customized

2014-04-28 Thread Paul Tötterman

>
> For files in user's home directories I would manage the skeleton files 
> using puppet and then when the user account is created they'll be copied 
> into their home directory. That obviously only works for new users though. 
> It won't account for existing users or for updating the file if it hasn't 
> been touched by the user yet.
>

$dir is in home just to make this easily testable using puppet apply. The 
files I'm planning to manage are in /etc and users have sudo rights.

/etc/skel is clearly the right way to handle initial home directory files.

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/208cbf21-c3e8-45fe-99ee-5b4ab7e598fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Only some Puppet Modules show up in Foreman

2014-04-28 Thread Dominic Cleal
On 25/04/14 12:23, myself3...@googlemail.com wrote:
> Hi there,
> 
> I am new to foreman and just installed version 1.2

I'd recommend using Foreman 1.4 or even 1.5 if you're doing a new
installation.  1.2 is a little old.

> Then I installed some puppet modules to my puppet environment production.
> In foreman later I imported the classes from my local puppet server
> 
> The import afterwards showed me some of the modules, but other modules
> are not shown
> My /etc/puppet/environments/production/modules consists of the following
> modules:
> 
> account
> concat
> ntp
> resolv_conf
> shorewall
> stdlib
> 
> In foreman I only see the ntp and resolv_conf modules
> Especially these puppet modules do not show up in foreman:
> puppet module install -i /etc/puppet/environments/production/modules
> torrancew/account

This module doesn't contain any classes, so it won't show up in the
class list.  Use its 'account' defined type from your own modules.

> puppet module install -i /etc/puppet/environments/production/modules
> inkblot/shorewall
> 
> Has someone an idea why these modules do not show up ?

I'd have expected a few classes from shorewall to show up.  Which
version of Puppet's installed?  Maybe the module's using a feature that
will only parse in a newer version.

-- 
Dominic Cleal
Red Hat Engineering

-- 
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/535E0348.3040308%40redhat.com.
For more options, visit https://groups.google.com/d/optout.