Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support defining extensions #157

Closed
matthewbarr opened this issue Feb 11, 2014 · 5 comments
Closed

Support defining extensions #157

matthewbarr opened this issue Feb 11, 2014 · 5 comments

Comments

@matthewbarr
Copy link

I'll probably get around to doing this myself, but for now, a reference issue.

@matthewbarr
Copy link
Author

Hmm: I've actually hit 2 cases where I need to define custom json blobs. Does it make sense to just make a type that will drop a JSON blob into the conf.d,? I'm actually wondering if there's that much value in making each thing (handlers, checks, etc) all their own type in ruby, vs using a puppet DSL for the differences between them?

I need to drop configs in for 2 different extensions, and for mailer.rb that requires the config to be in the top namespace as mailer, vs the handler name that I'm calling it.

This would allow a sufficiently advanced user to just write out fields in DSL and have that be converted to json, and poof! very simple way to deal w/ edge cases... Extensions are just files to be dropped from a source and a config file, so it would make things much easier to manage than making a full type & provider...

@jlambert121
Copy link
Contributor

I'm not sure what you mean "vs using a puppet DSL for the differences"

I'm not sure what you mean with configuring the mailer handler, could you elaborate some more?

I have my mailer handler defined like:

sensu::handler { 'mailer':
  type    => 'pipe',
  command => '/etc/sensu/handlers/mailer.rb',
  config  => {  'mail_from'     => 'sensu@company.com',
                'mail_to'       => 'me@company.com',
                'smtp_address'  => 'localhost',
                'smtp_port'     => 25
  },
}

I've thought about the ability to just drop a JSON blob in, but just haven't personally run across a need for it yet.

@matthewbarr
Copy link
Author

Well, if you call your mailer handler something other than mailer, - even mail, or default - it won't actually work :) It requires a top level configuration of mailer: VALUE, VALUE, VALUE.

As for what I meant: Each provider in ruby currently calls and makes a json file. There may not be a reason to have all those types & providers, vs one that just makes arbitrary json. Do the validation there, in the puppet class, vs using the ruby code as heavily. Haven't heavily looked at those yet, but for an extension, it's almost entirely custom options...

@octete
Copy link
Contributor

octete commented Aug 22, 2014

Hi,
Just pinging here to see if there's any plan to support extensions (and the config that it comes with it) via this module? Do any of you have a working PR? 😄

Thanks.

@jlambert121
Copy link
Contributor

Closed via #297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants