-
Notifications
You must be signed in to change notification settings - Fork 4
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
check_http and integrate into apache::vhost #1
Comments
Updated the check_http type with the required attributes. |
Update the check_http provider to use the insync? feature for url attribute. |
Updated the check_http provider with retry code, reusing the existing https://github.com/kamui/retriable gem |
Updated the check_http provider with debug messages |
Updated the unit tests to test retry mechanism, success, failure conditions |
Update the vhosts.pp for apache module |
(#1) update check_http provider and type with new attributes
check_http checks a HTTP or HTTPS endpoint for its status. To avoid false failures because of network issues (or delays in the service starting up) requests get retried a configurable amount of time until a good result is received.
check_http
type to have the following attributes:url
, namevar, String: the URL to test, allows http and https requestsheaders
, parameter, Hash[String, String]: a hash of headers to pass along with the request, defaults to{}
expected_statuses
, parameter, Array[Integer]: an array of acceptable HTTP status codes. If a request returns one of these status codes, it is considered a success. Defaults to[200]
body_matcher
, parameter, Regexp: a request is considered a success if the body of the HTTP response matches this regular expression. Defaults to//
request_timeout
, parameter, Numeric: number of seconds for a single request to wait for a response to return a success before aborting, defaults to10
retries
, parameter, Integer: number of requests to make before giving up, defaults to3
backoff
, parameter, Numeric: initial number of seconds to wait between requests, defaults to1
exponential_backoff_base
, parameter, Numeric: exponential base for the exponential backoff calculations, defaults to2
max_backoff
, parameter, Numeric: an upper limit to the backoff duration, defaults to10
timeout
, parameter, Numeric: number of seconds allocated overall for the check to return a success before giving up, defaults to60
Update the
check_http
provider to use theinsync?
feature from Allow custom insync? checking for resources puppet-resource_api#225 to be quiet (in sync) when the check succeeds, and report a regular error otherwise. See a7f60f2 for an example.Update the
check_http
provider to use the above attributes to execute up toretries
number of times with success being defined as having one of theexpected_statuses
and the body of the response matchesbody_matcher
while taking into accountrequest_timeout
.Update the
check_http
provider to wait forbackoff ** (exponential_backoff_base * (number_of_attempt - 1)
seconds between attempts (up tomax_backoff
), but aborting completely aftertimeout
seconds if no successful request could be made. Evaluate https://github.com/kamui/retriable for this.Update the
check_http
provider to log detailed messages at the debug level of requests, responses and backoff waits.Add unit tests for check_http provider changes
Update Opv puppetlabs-apache#2128 to use this resource for checking a configured vhost for correct deployment. Do not merge that PR as this is still experimental work.
Each change needs to be accompanied with appropriate unit and (changes to) acceptance tests proving the functionality.
The text was updated successfully, but these errors were encountered: