On Monday, June 18, 2012 12:18:51 PM UTC-7, jon wrote:
>
>   If so, is it possible to pass in parameterized classes this way, like:
>
> user@host$ cat openstackall.yaml     2012-06-18 14:56:01 jon pts/13
> ---
> classes:
> - openstack::all: {  
>   public_address: %{ipaddress_eth0},
>   public_interface: eth0,
>   private_interface: eth1,
>   admin_email: nob...@csail.mit.edu,
>   admin_password: admin_password,
>   keystone_admin_token: keystone_admin_token,
>   nova_user_password: nova_user_password,
>   glance_user_password: glance_user_password,
>   rabbit_password: rabbit_password,
>   rabbit_user: rabbit_user,
>   libvirt_type: kvm,
>   fixed_range: 10.0.0.0/24 }
>
>
>
Alas, no -- it really is just calling the "include" function, which doesn't 
handle class parameters. 

YOUR OPTIONS:

In puppet 3.0, "include" will automatically do a heira lookup of any class 
parameters you omit, which means you can give the list of classes to 
hiera_include and then specify class parameters right below. (like 
class::parameter1: "value" class::parameter2: "value")

OR

You could use the "create_resources" function to do what you want today. 
Just have to modify the yaml slightly, because you want a hash of hashes:

---
classes:
  example::test:
    parameter1: value1
  openstack::all:
    public_address: %{ipaddress_eth0}
    public_interface: eth0
    private_interface: eth1
    admin_email: nob...@csail.mit.edu
    admin_password: admin_password
    keystone_admin_token: keystone_admin_token
    nova_user_password: nova_user_password
    glance_user_password: glance_user_password
    rabbit_password: rabbit_password
    rabbit_user: rabbit_user
    libvirt_type: kvm
    fixed_range: 10.0.0.0/24

Then, in your manifest:

create_resources( 'class', hiera('classes') )

See here: 
http://docs.puppetlabs.com/references/latest/function.html#createresources

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/tsMyQ_Zc7OkJ.
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.

Reply via email to