Re: [Puppet Users] Moving config to an ENC

2011-07-13 Thread Justin Lambert
Thanks for the response Dan, that was an easy fix.


Here is a trace:
# puppet agent -t --trace
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/rest.rb:56:in `deserialize'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/rest.rb:75:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:188:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:50:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:240:in
`retrieve_new_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:429:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:428:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:239:in
`retrieve_new_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:86:in `retrieve_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:111:in
`retrieve_and_apply_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:150:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent/locker.rb:21:in `lock'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:103:in `with_client'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:37:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:172:in `call'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:172:in `controlled_run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:35:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:114:in `onetime'
/usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:88:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:420:in `hook'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:411:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:62:in `execute'
/usr/bin/puppet:4
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Invalid parameter yumreposerver::locations on node
kinks.corp.localmatters.com
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

On Tue, Jul 12, 2011 at 11:35 PM, Dan Bode d...@puppetlabs.com wrote:



 On Tue, Jul 12, 2011 at 10:43 AM, Justin Lambert 
 jlamb...@localmatters.com wrote:

 I have just gotten to playing with this and am doing something wrong,
 probably very basic.

 On the puppetmaster (which for my testing is also the client) I have
 create_resources.rb in /var/lib/puppet/lib/puppet/parser/functions.

 I wrote a new ENC that will just output a very basic YAML to test this,
 the output is:
 classes:
  yumreposerver:
   yumreposerver::locations:


centos5:
 distro: centos
 version: 5.6


 it should be something like:

 yumreposerver:
   instances:
 centos5:
   distro:
 ...

 there is no yumreposerver parameter in the yum server class, only an
 instances parameter



 In my modules directory I have yumreposerver/manifests/locations.pp:
 class yumreposerver::locations ( $instances = {} )
 {
   create_resources('yumreposerver::location', $instances)
 }

 yumreposerver/manifests/location.pp:
 define yumreposerver::location( $distro, $version ) {
 .
 }

 puppet agent -t --noop returns:
 err: Could not retrieve catalog from remote server: Error 400 on SERVER:
 Invalid parameter yumreposerver::locations on node name


 I agree that this is not a very clear error message, can you run with
 --trace?



  Puppet version 2.6.9 on SL6.

 Any insight as to where I have gone wrong?

 Thanks,
 jl

 On Wed, Jul 6, 2011 at 7:22 AM, Justin Lambert jlamb...@localmatters.com
  wrote:

 This looks exactly like what I was looking for, thank you.  This might be
 worth mentioning on the ENC page so people like myself can find it easier.


 On Tue, Jul 5, 2011 at 10:42 PM, Dan Bode d...@puppetlabs.com wrote:

 Hi J,

 The create resources function was created to serve this exact use case
 (the README actually mentions your exact use case :) )

 https://github.com/puppetlabs/puppetlabs-create_resources

 This will require 2.6.5 or higher to work (That is the first version
 where ENC's support param classes)

 The function was also merged into core in 2.7.0

 -Dan

 On Tue, Jul 5, 2011 at 1:40 PM, Justin Lambert 
 jlamb...@localmatters.com wrote:

 I have recently started moving the config of our puppet hosts out of
 the nodes files and into an ENC so they can be managed through a web UI by
 someone with less technical experience without the fear of a typo causing 
 a
 failure of all catalogs to compile.  As a result, I have been looking at
 which modules need to be rewritten to support this.  The problem I have 
 run
 into is, how do you do something such as add multiple virtual hosts using
 the YAML output of an ENC?

 I currently have 

Re: [Puppet Users] Moving config to an ENC

2011-07-12 Thread Justin Lambert
I have just gotten to playing with this and am doing something wrong,
probably very basic.

On the puppetmaster (which for my testing is also the client) I have
create_resources.rb in /var/lib/puppet/lib/puppet/parser/functions.

I wrote a new ENC that will just output a very basic YAML to test this, the
output is:
classes:
 yumreposerver:
  yumreposerver::locations:
   centos5:
distro: centos
version: 5.6

In my modules directory I have yumreposerver/manifests/locations.pp:
class yumreposerver::locations ( $instances = {} )
{
  create_resources('yumreposerver::location', $instances)
}

yumreposerver/manifests/location.pp:
define yumreposerver::location( $distro, $version ) {
.
}

puppet agent -t --noop returns:
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Invalid parameter yumreposerver::locations on node name

 Puppet version 2.6.9 on SL6.

Any insight as to where I have gone wrong?

Thanks,
jl

On Wed, Jul 6, 2011 at 7:22 AM, Justin Lambert jlamb...@localmatters.comwrote:

 This looks exactly like what I was looking for, thank you.  This might be
 worth mentioning on the ENC page so people like myself can find it easier.


 On Tue, Jul 5, 2011 at 10:42 PM, Dan Bode d...@puppetlabs.com wrote:

 Hi J,

 The create resources function was created to serve this exact use case
 (the README actually mentions your exact use case :) )

 https://github.com/puppetlabs/puppetlabs-create_resources

 This will require 2.6.5 or higher to work (That is the first version where
 ENC's support param classes)

 The function was also merged into core in 2.7.0

 -Dan

 On Tue, Jul 5, 2011 at 1:40 PM, Justin Lambert jlamb...@localmatters.com
  wrote:

 I have recently started moving the config of our puppet hosts out of the
 nodes files and into an ENC so they can be managed through a web UI by
 someone with less technical experience without the fear of a typo causing a
 failure of all catalogs to compile.  As a result, I have been looking at
 which modules need to be rewritten to support this.  The problem I have run
 into is, how do you do something such as add multiple virtual hosts using
 the YAML output of an ENC?

 I currently have something like:

 node 'web01.company.com' {
   apache::virtualhost { 'site1': location = '/hosted/site1', url = '
 http://site1.com' }
   apache::virtualhost { 'site2': location = '/hosted/site2', url = '
 http://site2.com' }
 }

 This uses 'define apache::virtualhost' in order to create multiple sites,
 works fine.  The YAML from an ENC (referencing
 http://docs.puppetlabs.com/guides/external_nodes.html) doesn't look to
 support this kind of definition so I need to find an alternative.  My next
 thought was that I can pass parameters to a parameterized class.  No love
 there as you can't instantiate a class multiple times with different
 parameters.  How are others solving this issue?

 Thanks,
 jl

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


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




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



Re: [Puppet Users] Moving config to an ENC

2011-07-12 Thread Denmat
Hi, is 'something::other' valid in yaml?
Cheers
Den

On 13/07/2011, at 3:43, Justin Lambert jlamb...@localmatters.com wrote:

 I have just gotten to playing with this and am doing something wrong, 
 probably very basic.
 
 On the puppetmaster (which for my testing is also the client) I have 
 create_resources.rb in /var/lib/puppet/lib/puppet/parser/functions.
 
 I wrote a new ENC that will just output a very basic YAML to test this, the 
 output is:
 classes:
  yumreposerver:
   yumreposerver::locations:
centos5:
 distro: centos
 version: 5.6
 
 In my modules directory I have yumreposerver/manifests/locations.pp:
 class yumreposerver::locations ( $instances = {} )
 {
   create_resources('yumreposerver::location', $instances)
 }
 
 yumreposerver/manifests/location.pp:
 define yumreposerver::location( $distro, $version ) {
 .
 }
 
 puppet agent -t --noop returns:
 err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
 Invalid parameter yumreposerver::locations on node name
 
  Puppet version 2.6.9 on SL6.
 
 Any insight as to where I have gone wrong?
 
 Thanks,
 jl
 
 On Wed, Jul 6, 2011 at 7:22 AM, Justin Lambert jlamb...@localmatters.com 
 wrote:
 This looks exactly like what I was looking for, thank you.  This might be 
 worth mentioning on the ENC page so people like myself can find it easier.
 
 
 On Tue, Jul 5, 2011 at 10:42 PM, Dan Bode d...@puppetlabs.com wrote:
 Hi J,
 
 The create resources function was created to serve this exact use case (the 
 README actually mentions your exact use case :) )
 
 https://github.com/puppetlabs/puppetlabs-create_resources
 
 This will require 2.6.5 or higher to work (That is the first version where 
 ENC's support param classes)
 
 The function was also merged into core in 2.7.0
 
 -Dan
 
 On Tue, Jul 5, 2011 at 1:40 PM, Justin Lambert jlamb...@localmatters.com 
 wrote:
 I have recently started moving the config of our puppet hosts out of the 
 nodes files and into an ENC so they can be managed through a web UI by 
 someone with less technical experience without the fear of a typo causing a 
 failure of all catalogs to compile.  As a result, I have been looking at 
 which modules need to be rewritten to support this.  The problem I have run 
 into is, how do you do something such as add multiple virtual hosts using the 
 YAML output of an ENC? 
 
 I currently have something like:
 
 node 'web01.company.com' {
   apache::virtualhost { 'site1': location = '/hosted/site1', url = 
 'http://site1.com' }
   apache::virtualhost { 'site2': location = '/hosted/site2', url = 
 'http://site2.com' }
 }
 
 This uses 'define apache::virtualhost' in order to create multiple sites, 
 works fine.  The YAML from an ENC (referencing 
 http://docs.puppetlabs.com/guides/external_nodes.html) doesn't look to 
 support this kind of definition so I need to find an alternative.  My next 
 thought was that I can pass parameters to a parameterized class.  No love 
 there as you can't instantiate a class multiple times with different 
 parameters.  How are others solving this issue?
 
 Thanks,
 jl
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.

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



Re: [Puppet Users] Moving config to an ENC

2011-07-12 Thread Justin Lambert
I am using the create_resource module backported from 2.7 to 2.6 to make
this possible.  The module I am using was recommeded by Dan Bode and can be
found at https://github.com/puppetlabs/puppetlabs-create_resources.

I'm sure it is just something in the way I am implementing it.

On Tue, Jul 12, 2011 at 2:33 PM, Denmat tu2bg...@gmail.com wrote:

 Hi, is 'something::other' valid in yaml?
 Cheers
 Den


 On 13/07/2011, at 3:43, Justin Lambert jlamb...@localmatters.com wrote:

 I have just gotten to playing with this and am doing something wrong,
 probably very basic.

 On the puppetmaster (which for my testing is also the client) I have
 create_resources.rb in /var/lib/puppet/lib/puppet/parser/functions.

 I wrote a new ENC that will just output a very basic YAML to test this, the
 output is:
 classes:
  yumreposerver:
   yumreposerver::locations:
centos5:
 distro: centos
 version: 5.6

 In my modules directory I have yumreposerver/manifests/locations.pp:
 class yumreposerver::locations ( $instances = {} )
 {
   create_resources('yumreposerver::location', $instances)
 }

 yumreposerver/manifests/location.pp:
 define yumreposerver::location( $distro, $version ) {
 .
 }

 puppet agent -t --noop returns:
 err: Could not retrieve catalog from remote server: Error 400 on SERVER:
 Invalid parameter yumreposerver::locations on node name

  Puppet version 2.6.9 on SL6.

 Any insight as to where I have gone wrong?

 Thanks,
 jl

 On Wed, Jul 6, 2011 at 7:22 AM, Justin Lambert jlamb...@localmatters.com
 jlamb...@localmatters.com wrote:

 This looks exactly like what I was looking for, thank you.  This might be
 worth mentioning on the ENC page so people like myself can find it easier.


 On Tue, Jul 5, 2011 at 10:42 PM, Dan Bode  d...@puppetlabs.com
 d...@puppetlabs.com wrote:

 Hi J,

 The create resources function was created to serve this exact use case
 (the README actually mentions your exact use case :) )

 https://github.com/puppetlabs/puppetlabs-create_resources
 https://github.com/puppetlabs/puppetlabs-create_resources

 This will require 2.6.5 or higher to work (That is the first version
 where ENC's support param classes)

 The function was also merged into core in 2.7.0

 -Dan

 On Tue, Jul 5, 2011 at 1:40 PM, Justin Lambert jlamb...@localmatters.com
 jlamb...@localmatters.com wrote:

 I have recently started moving the config of our puppet hosts out of the
 nodes files and into an ENC so they can be managed through a web UI by
 someone with less technical experience without the fear of a typo causing a
 failure of all catalogs to compile.  As a result, I have been looking at
 which modules need to be rewritten to support this.  The problem I have run
 into is, how do you do something such as add multiple virtual hosts using
 the YAML output of an ENC?

 I currently have something like:

 node ' http://web01.company.comweb01.company.com' {
   apache::virtualhost { 'site1': location = '/hosted/site1', url = 
 'http://site1.com
 http://site1.com' }
   apache::virtualhost { 'site2': location = '/hosted/site2', url = 
 'http://site2.com
 http://site2.com' }
 }

 This uses 'define apache::virtualhost' in order to create multiple
 sites, works fine.  The YAML from an ENC (referencing 
 http://docs.puppetlabs.com/guides/external_nodes.html
 http://docs.puppetlabs.com/guides/external_nodes.html) doesn't look to
 support this kind of definition so I need to find an alternative.  My next
 thought was that I can pass parameters to a parameterized class.  No love
 there as you can't instantiate a class multiple times with different
 parameters.  How are others solving this issue?

 Thanks,
 jl

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


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



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

  --
 You 

Re: [Puppet Users] Moving config to an ENC

2011-07-12 Thread Dan Bode
On Tue, Jul 12, 2011 at 10:43 AM, Justin Lambert
jlamb...@localmatters.comwrote:

 I have just gotten to playing with this and am doing something wrong,
 probably very basic.

 On the puppetmaster (which for my testing is also the client) I have
 create_resources.rb in /var/lib/puppet/lib/puppet/parser/functions.

 I wrote a new ENC that will just output a very basic YAML to test this, the
 output is:
 classes:
  yumreposerver:
   yumreposerver::locations:


   centos5:
 distro: centos
 version: 5.6


it should be something like:

yumreposerver:
  instances:
centos5:
  distro:
...

there is no yumreposerver parameter in the yum server class, only an
instances parameter



 In my modules directory I have yumreposerver/manifests/locations.pp:
 class yumreposerver::locations ( $instances = {} )
 {
   create_resources('yumreposerver::location', $instances)
 }

 yumreposerver/manifests/location.pp:
 define yumreposerver::location( $distro, $version ) {
 .
 }

 puppet agent -t --noop returns:
 err: Could not retrieve catalog from remote server: Error 400 on SERVER:
 Invalid parameter yumreposerver::locations on node name


I agree that this is not a very clear error message, can you run with
--trace?



  Puppet version 2.6.9 on SL6.

 Any insight as to where I have gone wrong?

 Thanks,
 jl

 On Wed, Jul 6, 2011 at 7:22 AM, Justin Lambert 
 jlamb...@localmatters.comwrote:

 This looks exactly like what I was looking for, thank you.  This might be
 worth mentioning on the ENC page so people like myself can find it easier.


 On Tue, Jul 5, 2011 at 10:42 PM, Dan Bode d...@puppetlabs.com wrote:

 Hi J,

 The create resources function was created to serve this exact use case
 (the README actually mentions your exact use case :) )

 https://github.com/puppetlabs/puppetlabs-create_resources

 This will require 2.6.5 or higher to work (That is the first version
 where ENC's support param classes)

 The function was also merged into core in 2.7.0

 -Dan

 On Tue, Jul 5, 2011 at 1:40 PM, Justin Lambert 
 jlamb...@localmatters.com wrote:

 I have recently started moving the config of our puppet hosts out of the
 nodes files and into an ENC so they can be managed through a web UI by
 someone with less technical experience without the fear of a typo causing a
 failure of all catalogs to compile.  As a result, I have been looking at
 which modules need to be rewritten to support this.  The problem I have run
 into is, how do you do something such as add multiple virtual hosts using
 the YAML output of an ENC?

 I currently have something like:

 node 'web01.company.com' {
   apache::virtualhost { 'site1': location = '/hosted/site1', url = '
 http://site1.com' }
   apache::virtualhost { 'site2': location = '/hosted/site2', url = '
 http://site2.com' }
 }

 This uses 'define apache::virtualhost' in order to create multiple
 sites, works fine.  The YAML from an ENC (referencing
 http://docs.puppetlabs.com/guides/external_nodes.html) doesn't look to
 support this kind of definition so I need to find an alternative.  My next
 thought was that I can pass parameters to a parameterized class.  No love
 there as you can't instantiate a class multiple times with different
 parameters.  How are others solving this issue?

 Thanks,
 jl

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


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



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


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



Re: [Puppet Users] Moving config to an ENC

2011-07-06 Thread Justin Lambert
This looks exactly like what I was looking for, thank you.  This might be
worth mentioning on the ENC page so people like myself can find it easier.

On Tue, Jul 5, 2011 at 10:42 PM, Dan Bode d...@puppetlabs.com wrote:

 Hi J,

 The create resources function was created to serve this exact use case (the
 README actually mentions your exact use case :) )

 https://github.com/puppetlabs/puppetlabs-create_resources

 This will require 2.6.5 or higher to work (That is the first version where
 ENC's support param classes)

 The function was also merged into core in 2.7.0

 -Dan

 On Tue, Jul 5, 2011 at 1:40 PM, Justin Lambert 
 jlamb...@localmatters.comwrote:

 I have recently started moving the config of our puppet hosts out of the
 nodes files and into an ENC so they can be managed through a web UI by
 someone with less technical experience without the fear of a typo causing a
 failure of all catalogs to compile.  As a result, I have been looking at
 which modules need to be rewritten to support this.  The problem I have run
 into is, how do you do something such as add multiple virtual hosts using
 the YAML output of an ENC?

 I currently have something like:

 node 'web01.company.com' {
   apache::virtualhost { 'site1': location = '/hosted/site1', url = '
 http://site1.com' }
   apache::virtualhost { 'site2': location = '/hosted/site2', url = '
 http://site2.com' }
 }

 This uses 'define apache::virtualhost' in order to create multiple sites,
 works fine.  The YAML from an ENC (referencing
 http://docs.puppetlabs.com/guides/external_nodes.html) doesn't look to
 support this kind of definition so I need to find an alternative.  My next
 thought was that I can pass parameters to a parameterized class.  No love
 there as you can't instantiate a class multiple times with different
 parameters.  How are others solving this issue?

 Thanks,
 jl

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


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


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



Re: [Puppet Users] Moving config to an ENC

2011-07-05 Thread Dan Bode
Hi J,

The create resources function was created to serve this exact use case (the
README actually mentions your exact use case :) )

https://github.com/puppetlabs/puppetlabs-create_resources

This will require 2.6.5 or higher to work (That is the first version where
ENC's support param classes)

The function was also merged into core in 2.7.0

-Dan

On Tue, Jul 5, 2011 at 1:40 PM, Justin Lambert jlamb...@localmatters.comwrote:

 I have recently started moving the config of our puppet hosts out of the
 nodes files and into an ENC so they can be managed through a web UI by
 someone with less technical experience without the fear of a typo causing a
 failure of all catalogs to compile.  As a result, I have been looking at
 which modules need to be rewritten to support this.  The problem I have run
 into is, how do you do something such as add multiple virtual hosts using
 the YAML output of an ENC?

 I currently have something like:

 node 'web01.company.com' {
   apache::virtualhost { 'site1': location = '/hosted/site1', url = '
 http://site1.com' }
   apache::virtualhost { 'site2': location = '/hosted/site2', url = '
 http://site2.com' }
 }

 This uses 'define apache::virtualhost' in order to create multiple sites,
 works fine.  The YAML from an ENC (referencing
 http://docs.puppetlabs.com/guides/external_nodes.html) doesn't look to
 support this kind of definition so I need to find an alternative.  My next
 thought was that I can pass parameters to a parameterized class.  No love
 there as you can't instantiate a class multiple times with different
 parameters.  How are others solving this issue?

 Thanks,
 jl

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


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