hello,
I would like to add a metaparameter - which I think is easy now via
Type.newmetaparam.
The thing that I can't seem to find any example of though is how to
make this metaparameter do something on the nodes for all providers
or all types.
Imagine there's a metaparam that might describe how to test a resource
works, something like:
service{"httpd": validate => "check_http --port 80 -H localhost"}
I'd then want to have some code that would be run on the agent nodes
for any resource that has this param set.
Does anyone have any hints or know of an example of this?
thanks
---
R.I.Pienaar
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/70254077.345165.1454514435921.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.
On Wed, Feb 3, 2016 at 7:47 AM, R.I.Pienaar <r...@devco.net> wrote:hello,
I would like to add a metaparameter - which I think is easy now via
Type.newmetaparam.We haven't been thinking of metaparameters as a general purpose extension point. This came up once before that I know of, about a year ago, and there's a little discussion of this in https://tickets.puppetlabs.com/browse/PUP-4281. The conclusion we reached at the time was, more or less, to explore whether the desired change could be accomplished with a puppet function and/or a change to core puppet.
The thing that I can't seem to find any example of though is how to
make this metaparameter do something on the nodes for all providers
or all types.
Imagine there's a metaparam that might describe how to test a resource
works, something like:
service{"httpd": validate => "check_http --port 80 -H localhost"}
I'd then want to have some code that would be run on the agent nodes
for any resource that has this param set.I don't think something like this exists per se, but 'validate' might be one such example of something worth adding to core puppet. Fwiw, one resource-specific example added not too long ago is the file type's validate_cmd:Also, I'm guessing you're aware but another tool in the toolbox *might* include the postrun_command setting (which is *not* per-provider as you were thinking):
More broadly, there has been some discussion on a few threads and tickets about making the agent lifecycle provide some more useful hooks, so I'd love to hear more ideas about how to improve this.
--Thanks!Kylo
Does anyone have any hints or know of an example of this?
thanks
---
R.I.Pienaar
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/70254077.345165.1454514435921.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CALsUZFHniTYyYU0ThP-Jk37f6QXroJ0P0-K0PkbRPXMsdB6v0Q%40mail.gmail.com.
For me this being in every provider is a nice to have I guess - it would be
great to be able to improve puppets ability to check if something worked
in the broad sense, and it's going to apply to all resource types equally.
I could take the route that https://github.com/nanliu/puppet-transport does
and instead of making the meta param do something use it just to store this
information and then some other module do something with this information and
that would let me play with what I want, but it seems a small step to improve
puppet in general.
I've told many people this story so no doubt you remember the context Luke
but what I'd like to do is allow people to attach these checks to resources
and of course use them in catalog apply stage to get a deeper sense of 'done'
in the same way that the File validate_cmd does but later I want to consume
the catalog in other tools and extract the same - or rather hopefully speak
to some API and get this.
Imagine I had a bridge to Sensu where it loads the catalog and just checks
everything that has a validate attached for free with no configuration required,
this is actually really easy with sensu as it doesnt require you to declare
the checks upfront on the server and all you have to do is write JSON to a
socket for every check, it'll promiscuously take them and show them and do
alerts etc.
Once you have this information and can surface it additionally into the Puppet
eco system you can gather the state regularly like a monitoring system does
and it becomes quite interesting later down the line when perhaps you can
use this to influence the node assignment logic in the orchastrator so that
a Web app will be configured to talk to a known good DB server - or that
you can detect that the web app should be reconfigured once it's chosen
DB isn't good anymore. That's quite far down the line though, I think just
being able to do the monitoring part into sensu would already be a huge win
for many.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/1273177970.271.1454659320271.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/454494855.237167.1456911800479.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/435304898.284658.1456916431327.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.
Hi all,This is a very interesting conversation and I'm monitoring to see where it ends up.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CANs%2BFoXjF%3DTh1o5vJBU9hW%3DHhmxNDcDf5CHAkc-TUM9HF4hxDA%40mail.gmail.com.
The meta parameter though has value - I see this to a large extend as user
serviceable. I get a module from the forge that has some provider, for me
a 'responds well' check might be < 10ms for others it might be < 100ms and
for others it might not even be a time based expression.. And the parameters
that makes up what is good - here I used response time - are actually very varied
so no doubt some space for getting this in a magical way for now a meta param
seems a easy thing to reason about for now while I look at how this works and
how feasible it is.
Another approach might be to introduce a more formal observer pattern into the
system, I've toyed with this a few times and there's a interesting example over
at https://forge.puppetlabs.com/ryanuber/tell though it's not what I want but
as a thing to look at and think about it's quite interesting. My thoughts are
not really well formed around it, but I did built a network wide observer for
puppet events and could do pretty crazy things with it, not sure they were
good ideas though.
> Wrt catalog format (or perhaps report format?) it would be interesting to
> explore whether we could adapt the format to facilitate such integrations.
> Currently both catalog format and report format are more serializations of
> internal data structures than they are designed as external integration
> points. I'd have to noodle on this some more, but it's definitely a course
> worth exploring.
Yeah, I've done nasty little things to extract information from catalogs and
they all broke recently with 4 :P Public APIs around interacting with it
would be good. A library to do so would be fantastic+1 for having an API to access resource attributes in the catalog. This would solve the entire class of issues where we need configuration data for types/providers.Here's an example:https://github.com/puppetlabs/puppetlabs-splunk/pull/14/files
Without this information, the splunk config files must exist where the the path is hardcoded in the resource type.
Thanks,Nan
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CACqVBqB5KfVe6na9SDRb_U8UJcfz_67-vFo4B%2BoOzxxDMhoXaQ%40mail.gmail.com.
On Wed, Feb 3, 2016 at 7:47 AM, R.I.Pienaar <r...@devco.net> wrote:hello,
I would like to add a metaparameter - which I think is easy now via
Type.newmetaparam.We haven't been thinking of metaparameters as a general purpose extension point. This came up once before that I know of, about a year ago, and there's a little discussion of this in https://tickets.puppetlabs.com/browse/PUP-4281. The conclusion we reached at the time was, more or less, to explore whether the desired change could be accomplished with a puppet function and/or a change to core puppet.
The thing that I can't seem to find any example of though is how to
make this metaparameter do something on the nodes for all providers
or all types.
Imagine there's a metaparam that might describe how to test a resource
works, something like:
service{"httpd": validate => "check_http --port 80 -H localhost"}
I'd then want to have some code that would be run on the agent nodes
for any resource that has this param set.I don't think something like this exists per se, but 'validate' might be one such example of something worth adding to core puppet. Fwiw, one resource-specific example added not too long ago is the file type's validate_cmd:
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/1062762368.96001.1456995522124.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.
Late to follow up on this but I had some time to work on this again,
Those checks you have in AO are good but the barrier to entry is quite high on
making those I felt
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/933229095.334955.1462798703903.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.
>
> validate or verify it works yes, what other uses did you have in mind?
I guess reporting or metrics or some sort of registration mechanism.
Their are other ways of doing those I realise, but as a light-weight
integration point this struck me as interesting. I'd probably stick
with validate or verify (ie. without the post_) though if it came to
that.
I could see modules shipping with a verify directory containing
scripts to run to confirm a working system too.
It really seems like we want the logical extension of the Exec checks on all resources with additional validation.
service { 'httpd':ensure => 'running',onlyif => '/usr/bin/probe_remote_mysql', # or 'unless'validate => "curl -k http://${::fqdn}/service_check.html",# Ok, magical asynchronous fact update here with an ACL (ponies and unicorns area....)fact_update => {'my_unique_name' => 'w00t',# ACLs would need to be processed server side. Let's not give the nodes too much power here...# This could, perhaps, be a server setting.'acl' => {'allow' => $::domain,'deny' => 'ALL'}}
class { 'thing_that_needs_apache':onlyif => fact_fetch('my_unique_name', 'w00t') # fact_fetch(<name>, <expected value/regex/math/whatever>)}
With the async updating of facts, and individual ACL restrictions, you get some really neat capabilities in terms of fine grained process control.
Thinking about this further, you'll probably need caching proxies for the fact updates though.
Maybe Puppet 8 :-D.
Thanks,
Trevor