Hi,

No, that is impossible to do. Once a class is declared it cannot be undeclared. Puppet is an additive model.

The way that node inheritance works means you can *NOT* even do this:

class prod_scripts {
  if ($actually_do_prod_scripts) {
    ...
    ...
  }
}

node prod_base {
  include prod_scripts
}

node server1 inherits prod_base {
  $actually_do_prod_scripts = 1
}

... because $actually_do_prod_scripts is not defined when your prod_base node declares your prod_scripts class.

Sorry to be the one to tell you, but when other people have asked about what you are asking the reply is usually to redesign what you're trying to do ;-)

Two ways forward:

Set all your variables in your nodes first, then at the last possible moment you start to instantiate classes, this gets around the inheritance model.

Redesign your modules and classes to be additive. If some nodes don't need 'base_scripts' then it's not really appropriate in node 'prod_base'.

Hope that helps,

-Luke

On 08/05/12 13:09, Munna S wrote:
Team,
can someone help me
Thanks,
Jeeva

On Mon, May 7, 2012 at 10:39 AM, Munna S <19.mu...@gmail.com <mailto:19.mu...@gmail.com>> wrote:

    Hi Team,
    sorry for the delay. My setup is like this.
    we have a 2 .pp file. one for production ( prod_base.pp)  and
    other for development ( dev_base.pp) under
    /etc/puppet/manifests/nodes . we have included the respective
    module in these 2 .pp files. for eg:
    prod_base.pp has the below content
    ---------------------------------------------------
    node prod_base {
            # Prod Module
            include prod_scripts
            include prod_disabled_services
            include prod_apache
    }
    --------------------------------------------------
    now we also have a different .pp file for individual servers under
    /etc/puppet/manifests/nodes by name servername.pp. for eg:
    server1.pp, server2.pp etc.. content of the server1.pp file is as
    below
    -------------------------------------------------
    node server1 inherits prod_base {
    }
    -------------------------------------------------
    now server1 inherits all the module which is mentioned in
    prod_base.pp.
    now my requirements is to exclude some of the modules from
    prod_base.pp for server server1.pp. How i can exclude certain
    module from the inherited list?
    Thanks,
    Jeeva


    On Wed, May 2, 2012 at 11:33 AM, Dan White <y...@comcast.net
    <mailto:y...@comcast.net>> wrote:

        ----- Munna S <19.mu...@gmail.com <mailto:19.mu...@gmail.com>>
        wrote:
        > Team,
        >
        > Any help?
        >
        > Thanks,
        > Jeeva
        >
        > On Wed, May 2, 2012 at 9:24 AM, Munna S <19.mu...@gmail.com
        <mailto:19.mu...@gmail.com>> wrote:
        >
        > > Team,
        > >
        > > Is there any way where we can exclude certain module from
        the inherited
        > > list
        > >
        > > Thanks,
        > > Munna
        > >

        http://www.catb.org/~esr/faqs/smart-questions.html
        <http://www.catb.org/%7Eesr/faqs/smart-questions.html>

        Two comments: I think you are a bit impatient, and I think
        there is insufficient detail/info to formulate an answer.

        “Sometimes I think the surest sign that intelligent life
        exists elsewhere in the universe is that none of it has tried
        to contact us.”
        Bill Waterson (Calvin & Hobbes)

        --
        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
        <mailto:puppet-users@googlegroups.com>.
        To unsubscribe from this group, send email to
        puppet-users+unsubscr...@googlegroups.com
        <mailto:puppet-users%2bunsubscr...@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.


--
Luke Bigum

Information Systems
Ph: +44 (0) 20 3192 2520
luke.bi...@lmax.com | http://www.lmax.com
LMAX, Yellow Building, 1A Nicholas Road, London W11 4AN



FX and CFDs are leveraged products that can result in losses exceeding
your deposit.  They are not suitable for everyone so please ensure you
fully understand the risks involved.  The information in this email is not
directed at residents of the United States of America or any other
jurisdiction where trading in CFDs and/or FX is restricted or prohibited
by local laws or regulations.

The information in this email and any attachment is confidential and is
intended only for the named recipient(s). The email may not be disclosed
or used by any person other than the addressee, nor may it be copied in
any way. If you are not the intended recipient please notify the sender
immediately and delete any copies of this message. Any unauthorised
copying, disclosure or distribution of the material in this e-mail is
strictly forbidden.

LMAX operates a multilateral trading facility. Authorised and regulated by the Financial Services Authority (firm registration number 509778) and is registered in England and Wales (number 06505809). Our registered address is Yellow Building, 1A Nicholas Road, London, W11
4AN.

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