Thanks Ryan! I'm looking for something like a "break" statement, which should not proceed execution of following resources.
Anyway thanks for the information about future parser. Appreciate your time in answering my question. Thanks, jay On Oct 10, 2013 11:57 AM, "Ryan Coleman" <[email protected]> wrote: > Hi Jay, > > You could simplify things a little using 'unless' which acts like the > reverse of 'if'. You'd place your resources within the unless block so that > they'd only be included in your catalog if your Fact or variable evaluated > to false. > http://docs.puppetlabs.com/puppet/3/reference/lang_conditional.html#unless-statements > > I suspect this isn't exactly what you're looking for I wanted to take this > opportunity to remind you that Puppet 3.2 introduced an experimental future > parser that makes it pretty simple to collect and iterate over things. > Maybe it'll help at some point down the road. > http://docs.puppetlabs.com/puppet/3/reference/lang_experimental_3_2.html > > Hope that helps, > --Ryan > > On Wed, Oct 9, 2013 at 6:13 PM, Jay <[email protected]> wrote: > >> Hi, >> >> I have a puppet module with more than 15 blocks of resources.. based on a >> validation I want puppet to decide to continue next blocks or skip with a >> warning(with out failing). >> >> currently I am doing this with a big if block. >> >> class mymodule { >> if $::flag_enabled { >> package {...} >> >> files {...} >> .... >> } >> else >> { >> warning("Flag is disabled") >> } >> } >> >> Is there a way to skip the module something like this? >> >> class mymodule { >> >> if not $::flag_enabled { >> warning("Flag is disabled, skipping mymodule") >> //skip executing below resources >> } >> package {..} >> file {...} >> } >> >> Appreciate your help on this. >> >> Regards, >> Jay >> >> -- >> 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 [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/puppet-users. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > Ryan Coleman | Modules & Forge | ryanycoleman on twitter & #puppet IRC > > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
