-
Notifications
You must be signed in to change notification settings - Fork 22
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
Use a guard and not .error? method for sensu_ctl #74
base: master
Are you sure you want to change the base?
Conversation
I don't remember the reason for trying to use .error? to check the output of the shell exec. What matters though is that the configure is run once when needed and not every time once it's already configured. This change switches to using a guard and a method to compare the configured backend url. The shortcoming of this approach is that as resource is currently written it supports a username and password property, however we do not have an implementation that can safely handle reconfiguring these values so they will only work the first time the resource is used.
@majormoses just a start here to experiment with an alternate approach |
This one still needs work and isn’t ready to be included for #80 yet |
execute 'configure sensuctl' do | ||
command sensuctl_configure_cmd | ||
sensitive true unless new_resource.debug | ||
not_if { config['api-url'] == new_resource.backend_url } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this still would not allow you to reconfigure the credentials using the same URL, I am wondering if we should perhaps have a configure and reconfigure actions with their own distinct logic (yes I realize this is very anti pattern) as I can't seem to find a good middle ground that gives us what we want for both scenarios.
I don't remember the reason for trying to use
.error?
to check theoutput of the shell exec. What matters though is that the configure is
run once when needed and not every time once it's already configured.
This change switches to using a guard and a method to compare the
configured backend url.
The shortcoming of this approach is that as the resource is currently
written it supports a username and password property, however we do not
have an implementation that can safely handle reconfiguring these
values so they will only work the first time the resource is used.
Fixes #63
Pull Request Checklist
Is this in reference to an existing issue?
General
Update Changelog following the conventions laid out here
Update README with any necessary configuration snippets
Cookstyle (rubocop) passes
Foodcritic passes
Rspec (unit tests) passes
Inspec (integration tests) passes
New Features
Added a Testing Artifact as either an automated test or a manual artifact on the PR.
Adedd documentation for it to the
README.md
Purpose
Known Compatibility Issues