FAQ
I need to be able to run a certain class ONLY when it is called
manually from the client.

I created a class named "manual" and can run it from the client like
this:

puppet agent --no-daemonize --onetime --verbose --tags=manual

However it only works if that class is specified in the node
definition. I don't want this class to run automatically on the
normal node run with the other classes. Is there any way to do this?

--
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 puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Keith Burdis at May 16, 2013 at 8:47 pm
    Perhaps try:

    # puppet apply --execute 'include manual'

       - Keith
      On 16 May 2013 21:40, "Nev" wrote:

    I need to be able to run a certain class ONLY when it is called
    manually from the client.

    I created a class named "manual" and can run it from the client like
    this:

    puppet agent --no-daemonize --onetime --verbose --tags=manual

    However it only works if that class is specified in the node
    definition. I don't want this class to run automatically on the
    normal node run with the other classes. Is there any way to do this?

    --
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Nev at May 16, 2013 at 10:40 pm
    thanks, but no:

    # puppet apply --execute 'include manual'
    Error: Could not find class manual
    On Thursday, May 16, 2013 2:47:35 PM UTC-6, Keith Burdis wrote:

    Perhaps try:

    # puppet apply --execute 'include manual'

    - Keith
    On 16 May 2013 21:40, "Nev" <nev...@gmail.com <javascript:>> wrote:

    I need to be able to run a certain class ONLY when it is called
    manually from the client.

    I created a class named "manual" and can run it from the client like
    this:

    puppet agent --no-daemonize --onetime --verbose --tags=manual

    However it only works if that class is specified in the node
    definition. I don't want this class to run automatically on the
    normal node run with the other classes. Is there any way to do this?

    --
    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 puppet-users...@googlegroups.com <javascript:>.
    To post to this group, send email to puppet...@googlegroups.com<javascript:>
    .
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Keith Burdis at May 17, 2013 at 5:36 am
    If you don't want to transfer the class files (and any dependencies) over
    to the agent host, which is what I was suggesting here then perhaps you can
    get your desired behaviour using a custom fact.

    Assuming that you have facter.dot.d installed (usually from stdlib) do
    something like:

       $ echo 'run_manual: false' >> /etc/facter/facter.d/custom.yaml

    And then check this fact before including your manual class in your node
    config, something like:

       if $run_manual {
         include manual
       }

    Then when you do want to apply the class then change the fact value to true
    and do a onetime Puppet run.

    Details above might be slightly off as I am not in from of a computer but
    you get the idea.

       - Keith
    On 16 May 2013 23:40, "Nev" wrote:

    thanks, but no:

    # puppet apply --execute 'include manual'
    Error: Could not find class manual
    On Thursday, May 16, 2013 2:47:35 PM UTC-6, Keith Burdis wrote:

    Perhaps try:

    # puppet apply --execute 'include manual'

    - Keith
    On 16 May 2013 21:40, "Nev" wrote:

    I need to be able to run a certain class ONLY when it is called
    manually from the client.

    I created a class named "manual" and can run it from the client like
    this:

    puppet agent --no-daemonize --onetime --verbose --tags=manual

    However it only works if that class is specified in the node
    definition. I don't want this class to run automatically on the
    normal node run with the other classes. Is there any way to do this?

    --
    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 puppet-users...@googlegroups.com.
    To post to this group, send email to puppet...@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jcbollinger at May 17, 2013 at 1:01 pm

    On Thursday, May 16, 2013 3:38:23 PM UTC-5, Nev wrote:
    I need to be able to run a certain class ONLY when it is called
    manually from the client.

    I created a class named "manual" and can run it from the client like
    this:

    puppet agent --no-daemonize --onetime --verbose --tags=manual

    However it only works if that class is specified in the node
    definition. I don't want this class to run automatically on the
    normal node run with the other classes. Is there any way to do this?

    No, there is no way for the agent to override the master's determination of
    which classes are applicable to the client node. This is a security
    feature, among other things -- otherwise, any node could extract
    possibly-sensitive information from the master that was not intended for
    it. The agent can narrow the classes to be applied, as in your example
    command, but it cannot expand it.

    Now, find a comfortable position, close your eyes, and repeat the Puppet
    mantra:

    Puppet is not a script engine...
    Puppet is not a script engine...
    Puppet is not a script engine...
    Om...

    Repeat as needed.


    If you nevertheless insist on using Puppet as if it *were* a script engine,
    then you need to have all the relevant manifests, files, etc. on the local
    node, so that you can use "puppet apply" to apply them.


    John

    --
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Nev at May 17, 2013 at 2:50 pm
    Thank you Keith and John. I realize what I'm doing is an edge case and it
    is something I will rarely use. I'll copy the assets to the clients and
    use the apply function.

    On Friday, May 17, 2013 7:01:38 AM UTC-6, jcbollinger wrote:


    On Thursday, May 16, 2013 3:38:23 PM UTC-5, Nev wrote:

    I need to be able to run a certain class ONLY when it is called
    manually from the client.

    I created a class named "manual" and can run it from the client like
    this:

    puppet agent --no-daemonize --onetime --verbose --tags=manual

    However it only works if that class is specified in the node
    definition. I don't want this class to run automatically on the
    normal node run with the other classes. Is there any way to do this?

    No, there is no way for the agent to override the master's determination
    of which classes are applicable to the client node. This is a security
    feature, among other things -- otherwise, any node could extract
    possibly-sensitive information from the master that was not intended for
    it. The agent can narrow the classes to be applied, as in your example
    command, but it cannot expand it.

    Now, find a comfortable position, close your eyes, and repeat the Puppet
    mantra:

    Puppet is not a script engine...
    Puppet is not a script engine...
    Puppet is not a script engine...
    Om...

    Repeat as needed.


    If you nevertheless insist on using Puppet as if it *were* a script
    engine, then you need to have all the relevant manifests, files, etc. on
    the local node, so that you can use "puppet apply" to apply them.


    John
    --
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Pete Brown at May 20, 2013 at 3:25 am
    On 17 May 2013 23:01, jcbollinger wrote:
    On Thursday, May 16, 2013 3:38:23 PM UTC-5, Nev wrote:

    I need to be able to run a certain class ONLY when it is called
    manually from the client.

    I created a class named "manual" and can run it from the client like
    this:

    puppet agent --no-daemonize --onetime --verbose --tags=manual

    However it only works if that class is specified in the node
    definition. I don't want this class to run automatically on the
    normal node run with the other classes. Is there any way to do this?

    No, there is no way for the agent to override the master's determination
    of which classes are applicable to the client node. This is a security
    feature, among other things -- otherwise, any node could extract
    possibly-sensitive information from the master that was not intended for
    it. The agent can narrow the classes to be applied, as in your example
    command, but it cannot expand it.

    Now, find a comfortable position, close your eyes, and repeat the Puppet
    mantra:

    Puppet is not a script engine...
    Puppet is not a script engine...
    Puppet is not a script engine...
    Om...

    Repeat as needed.
    Excellent manta John.

    I may be quoting you in the future.

    If you nevertheless insist on using Puppet as if it *were* a script
    engine, then you need to have all the relevant manifests, files, etc. on
    the local node, so that you can use "puppet apply" to apply them.


    John

    --
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    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 puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedMay 16, '13 at 8:40p
activeMay 20, '13 at 3:25a
posts7
users4
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase