On Fri, Sep 14, 2012 at 06:37:28PM +0200, Jakov Sosic wrote:
> Hi.
> 
> I've successfully written and tested three puppet custom types for
> managing cobbler so far (distro, repo and profile). So far it has been
> interesting week, learning ruby from zero, learning custom types etc.
> But I'm really satisfied with the results so far.
> 
> Now I'm trying to figure out how to write rather complex provider, so
> maybe someone can help with some thoughts or input.
> 
> What am I trying to do is write a provider for a command that looks
> something like this:
> 
> cobbler add system --name=blah \
>   --profile=someprofile  \
>   --interface=eth0 \
>     --mac=SOMEMAC \
>     --interface-type=bond_slave \
>     --interface-master=bond0 \
>   --interface=eth1 \
>     --mac=SOMEMAC \
>     --interface-type=bond_slave \
>     --interface-master=bond0 \
>   --interface-name=bond0 \
>     --interface-type=bond
>     --bonding-opts="miimon=300 mode=1 primary=eth0"
>     --ip-address=MYIP \

As you pointed out you can write different types and the system types
will create the system with no interfaces at all (if that is possible)
and the interface type will add them later on.

The second way I can think of is a delimiter if the interface options
are more or less always the same like

    interfaces => [
      'eth0:mac=SOME_MAC:type=bond_slave:master=band0',
      'eth1:...'
    ],

or the interface property could accept a hash. I have not tried it
myself but it should work because the puppetlabs f5 type seems to use
it:

https://github.com/puppetlabs/puppetlabs-f5#appendix

-Stefan

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

Reply via email to