I have got some clues. There is another method finalize that would be
called implicitly. In initialize method, input is validated at the
time of instantiation and iptables rules are generated in finalize
method at the time of clean-up. However, I would still appreciate your
help if someone can clarify how custom types really work inside the
puppet.

On Jun 29, 2:56 pm, Annie Rana <[email protected]> wrote:
> Hi all,
>
> I am new to Puppet and Ruby. Currently I am using puppet iptables work 
> (http://github.com/camptocamp/puppet-iptables/) to prioritise different types
> of network traffic on a linux machine (see the details 
> here,http://www.mail-archive.com/[email protected]/msg08810.html) 
> and I
> would also require to develop a custom TC type 
> (http://tldp.org/HOWTO/Traffic-Control-HOWTO/index.html) to create priority
> queues.
>
> The Iptables, the custom type that was developed by camptocamp 
> (http://github.com/camptocamp), is quite different from the standard puppet
> custom types’ development approach. Now looking at their code 
> (http://github.com/camptocamp/puppet-iptables/blob/master/lib/puppet/t...),
> I can see that they have defined an iptables type with many parameters
> same as the way puppet tutorials ask to do. In init/sudo.pp, when we will
> define an iptable rule such as:
>
> iptables { "iptables rule no. 1":
>   proto       => "tcp",
>   dport       => "80",
>   jump        => "ACCEPT",
>
> }
>
> , an iptables module's instance will be created and initialise method
> (constructor) will be invoked. What I don’t understand is the aftermath once
> the constructor is invoked. I have deployed iptables custom type module at
> my linux machine and it works fine so far. What I don’t understand is that
> once the rules are pushed in @@rules (module variable) in initialise method
> then what happens next because there is not any explicit method call or code
> block within initialise method or even after that. It is very important for
> me to understand the flow because TC rules would also be incorporated with
> same iptables rules.
>
> I have looked at the standard approach of developing the custom types here:
>
> http://projects.puppetlabs.com/projects/puppet/wiki/Development_Pract...http://projects.puppetlabs.com/projects/puppet/wiki/Development_Provi...http://projects.puppetlabs.com/projects/puppet/wiki/Development_Compl...http://docs.puppetlabs.com/guides/custom_types.html
>
> But in reality it is not as simple as it is shown in above tutorials. If you
> look at the custom type code for iptables at the following website, you will
> see it is different from the standard approach of developing puppet custom
> types:
>
> http://github.com/camptocamp/puppet-iptables
>
> I contacted the camptocamp team but they are asking me to post my questions
> at this mailing list. Can anyone of you please help me to clarify how it is
> really working? I know it might be very basic question that I am asking and
> may be I don’t understand how custom types really work in puppet, but if you
> can help me in understanding the code flow/sequence, it would be great help
> for me.
>
> Thanks,
>
> Annie

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to