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

Modify sensu::check to use defined type sensu::write_json instead of native type sensu_check #783

Closed
jeffmccune opened this issue Jul 27, 2017 · 3 comments · Fixed by #785
Assignees

Comments

@jeffmccune
Copy link
Collaborator

In an effort to support arbitrary configuration scopes for plugins and extensions as mentioned in #764, the goal of this card is to implement a new parameter to the sensu::check defined type. This parameter needs a reasonable name (config is too generic and over-loaded). The desired behavior is to have the new parameter merged with all other parameters to produce a single, top-level JSON object written to the filesystem using sensu::write_json.

For the purposes of the change, two scopes are considered. All configuration in-scope is nested under checks.mycheck for a check named mycheck. All configuration out-of-scope is outside the nested checks.mycheck map. All out-of-scope configuration is managed by the new parameter, all in-scope configuration is managed by the existing parameters.

The new parameter is akin to the existing custom parameter, just at the top level instead of nested inside the check configuration scope.

@ghoneycutt
Copy link
Collaborator

How about content since that's what we are effectively setting with the data. Eventually custom and the other parameters will go away and all data will use the single parameter. We can use the struct data type for validation.

@jeffmccune
Copy link
Collaborator Author

How about content

I like it. The best I came up with was additional and content is way better.

jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 27, 2017
…e_json

Without this patch arbitrary to-level configuration scope items cannot be
managed in a sensu check.  This patch addresses the problem by adding a
`content` parameter to the sensu::check defined type.

This patch changes the defined type to pass a JSON object to sensu::write_json
instead of passing each named property to the sensu_check custom type.
sensu::write_json is used to ensure all attributes in a configuration file are
manageable and arbitrary attributes need only be placed in the `content` hash
map, or have a new parameter defined in the `sensu::check` defined type.

When adding a new parameter, as long as the parameter and value are passed as a
key/value pare to the `sensu_check_content()` function, the attribute and value
will be placed in the check configuration scope under checks.mycheck.  The same
behavior may be achieved by passing the key and value via the `custom`
parameter.

The ultimate goal of this work is to eliminate the `custom` parameter and
eventually refactor all defined types in the Puppet module to use
sensu::write_json and this approach.
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 27, 2017
…e_json

Without this patch arbitrary to-level configuration scope items cannot be
managed in a sensu check.  This patch addresses the problem by adding a
`content` parameter to the sensu::check defined type.

This patch changes the defined type to pass a JSON object to sensu::write_json
instead of passing each named property to the sensu_check custom type.
sensu::write_json is used to ensure all attributes in a configuration file are
manageable and arbitrary attributes need only be placed in the `content` hash
map, or have a new parameter defined in the `sensu::check` defined type.

When adding a new parameter, as long as the parameter and value are passed as a
key/value pare to the `sensu_check_content()` function, the attribute and value
will be placed in the check configuration scope under checks.mycheck.  The same
behavior may be achieved by passing the key and value via the `custom`
parameter.

The ultimate goal of this work is to eliminate the `custom` parameter and
eventually refactor all defined types in the Puppet module to use
sensu::write_json and this approach.

Resolves sensu#783
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 27, 2017
…e_json

Without this patch arbitrary to-level configuration scope items cannot be
managed in a sensu check.  This patch addresses the problem by adding a
`content` parameter to the sensu::check defined type.

This patch changes the defined type to pass a JSON object to sensu::write_json
instead of passing each named property to the sensu_check custom type.
sensu::write_json is used to ensure all attributes in a configuration file are
manageable and arbitrary attributes need only be placed in the `content` hash
map, or have a new parameter defined in the `sensu::check` defined type.

When adding a new parameter, as long as the parameter and value are passed as a
key/value pare to the `sensu_check_content()` function, the attribute and value
will be placed in the check configuration scope under checks.mycheck.  The same
behavior may be achieved by passing the key and value via the `custom`
parameter.

The ultimate goal of this work is to eliminate the `custom` parameter and
eventually refactor all defined types in the Puppet module to use
sensu::write_json and this approach.

Resolves sensu#783
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 28, 2017
…e_json

Without this patch arbitrary to-level configuration scope items cannot be
managed in a sensu check.  This patch addresses the problem by adding a
`content` parameter to the sensu::check defined type.

This patch changes the defined type to pass a JSON object to sensu::write_json
instead of passing each named property to the sensu_check custom type.
`sensu::write_json` is used to ensure all attributes in a configuration file are
manageable and arbitrary attributes need only be placed in the `content` hash
map.

The ultimate goal of this work is to eliminate the `custom` parameter and
eventually refactor all defined types in the Puppet module to use
sensu::write_json and this approach.

Resolves sensu#783
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 28, 2017
…e_json

Without this patch arbitrary to-level configuration scope items cannot be
managed in a sensu check.  This patch addresses the problem by adding a
`content` parameter to the sensu::check defined type.

This patch changes the defined type to pass a JSON object to sensu::write_json
instead of passing each named property to the sensu_check custom type.
`sensu::write_json` is used to ensure all attributes in a configuration file are
manageable and arbitrary attributes need only be placed in the `content` hash
map.

The ultimate goal of this work is to eliminate the `custom` parameter and
eventually refactor all defined types in the Puppet module to use
sensu::write_json and this approach.

Resolves sensu#783
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 28, 2017
…e_json

Without this patch arbitrary to-level configuration scope items cannot be
managed in a sensu check.  This patch addresses the problem by adding a
`content` parameter to the sensu::check defined type.

This patch changes the defined type to pass a JSON object to sensu::write_json
instead of passing each named property to the sensu_check custom type.
`sensu::write_json` is used to ensure all attributes in a configuration file are
manageable and arbitrary attributes need only be placed in the `content` hash
map.

The ultimate goal of this work is to eliminate the `custom` parameter and
eventually refactor all defined types in the Puppet module to use
sensu::write_json and this approach.

Resolves sensu#783
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 28, 2017
…e_json

Without this patch arbitrary to-level configuration scope items cannot be
managed in a sensu check.  This patch addresses the problem by adding a
`content` parameter to the sensu::check defined type.

This patch changes the defined type to pass a JSON object to sensu::write_json
instead of passing each named property to the sensu_check custom type.
`sensu::write_json` is used to ensure all attributes in a configuration file are
manageable and arbitrary attributes need only be placed in the `content` hash
map.

The ultimate goal of this work is to eliminate the `custom` parameter and
eventually refactor all defined types in the Puppet module to use
sensu::write_json and this approach.

Resolves sensu#783
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 28, 2017
Without this patch arbitrary to-level configuration scope items cannot be
managed in a sensu check.  This patch addresses the problem by adding a
`content` parameter to the sensu::check defined type.

This patch changes the defined type to pass a JSON object to sensu::write_json
instead of passing each named property to the sensu_check custom type.
`sensu::write_json` is used to ensure all attributes in a configuration file are
manageable and arbitrary attributes need only be placed in the `content` hash
map.

The ultimate goal of this work is to eliminate the `custom` parameter and
eventually refactor all defined types in the Puppet module to use
sensu::write_json and this approach.

Resolves sensu#783
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 28, 2017
Without this patch arbitrary to-level configuration scope items cannot be
managed in a sensu check.  This patch addresses the problem by adding a
`content` parameter to the sensu::check defined type.

This patch changes the defined type to pass a JSON object to sensu::write_json
instead of passing each named property to the sensu_check custom type.
`sensu::write_json` is used to ensure all attributes in a configuration file are
manageable and arbitrary attributes need only be placed in the `content` hash
map.

The ultimate goal of this work is to eliminate the `custom` parameter and
eventually refactor all defined types in the Puppet module to use
sensu::write_json and this approach.

Resolves sensu#783
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Aug 15, 2017
Without this patch arbitrary to-level configuration scope items cannot be
managed in a sensu check.  This patch addresses the problem by adding a
`content` parameter to the sensu::check defined type.

This patch changes the defined type to pass a JSON object to sensu::write_json
instead of passing each named property to the sensu_check custom type.
`sensu::write_json` is used to ensure all attributes in a configuration file are
manageable and arbitrary attributes need only be placed in the `content` hash
map.

The ultimate goal of this work is to eliminate the `custom` parameter and
eventually refactor all defined types in the Puppet module to use
sensu::write_json and this approach.

Resolves sensu#783
ghoneycutt added a commit that referenced this issue Aug 18, 2017
(#783) Add sensu::check content parameter, use sensu::write_json
@ghoneycutt
Copy link
Collaborator

Released in v2.32.0

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

Successfully merging a pull request may close this issue.

2 participants