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

json providers can not "unset" properties #394

Closed
jhoblitt opened this issue Aug 4, 2015 · 5 comments
Closed

json providers can not "unset" properties #394

jhoblitt opened this issue Aug 4, 2015 · 5 comments

Comments

@jhoblitt
Copy link
Contributor

jhoblitt commented Aug 4, 2015

Consider the following sensu_check resource declaration

  sensu_check { 'foo':
    ensure    => present,
    handlers  => 'bar',
    ...
  }

which should generate a check json file similar to:

{
  "checks": {
    "foo": {
      "handlers": [
        "bar"
      ],
      ....
    }
  }
}

If on a successive run, the handlers param is removed or set to 'undef'. e.g.:

  sensu_check { 'foo':
    ensure    => present,
    handlers  => undef,
    ...
  }

the handlers property is treated as unmanaged and the providers mutator method is never invoked. This essentially means that manual editing or deletion of the configuration tree is the only way to unset previously set values.

Would it be reasonable to add a param to all of the json config generator types to have the provider purge unmanaged properties?

@jlambert121
Copy link
Contributor

This is an issue with puppet 3.x where it is not able to determine an "unset" value in a type/provider since prior to puppet 4 there wasn't a true undefined type. Are you running 3.x nodes?

@jhoblitt
Copy link
Contributor Author

jhoblitt commented Aug 6, 2015

I've been whining about problems with :undef since the redmine days. :) I'm not sure why the behavior is different with 4.x, I guess I'll have to look at the generated catalog. Can you confirm this issue isn't present under 4?

@jlambert121
Copy link
Contributor

While I am running puppet 4 I haven't actually verified it.

@jlambert121
Copy link
Contributor

@jhoblitt have you tested this under 4.x (or future parser)? Any results you can share?

@jlambert121
Copy link
Contributor

Let me know if you're still seeing this issue under 4.x as well.

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

2 participants