Add ansible provisioning (#122)
* first ansible skeleton * first commit of ansible installation of vulnwhisperer outside docker * first ansible skeleton * first commit of ansible installation of vulnwhisperer outside docker * refactor the ansible role a bit * update readme, add fail validation step to provision.yml and fix typo when calling a logging funciton
This commit is contained in:

committed by
Quim Montal

parent
a8671a7303
commit
3a09f60543
@ -0,0 +1,26 @@
|
||||
require 'serverspec'
|
||||
require 'net/http'
|
||||
require 'json'
|
||||
|
||||
set :backend, :exec
|
||||
|
||||
require 'rspec/retry'
|
||||
|
||||
RSpec.configure do |config|
|
||||
# show retry status in spec process
|
||||
config.verbose_retry = true
|
||||
# show exception that triggers a retry if verbose_retry is set to true
|
||||
config.display_try_failure_messages = true
|
||||
end
|
||||
|
||||
def curl_json(uri, username=nil, password=nil)
|
||||
uri = URI(uri)
|
||||
req = Net::HTTP::Get.new(uri)
|
||||
if username && password
|
||||
req.basic_auth username, password
|
||||
end
|
||||
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
|
||||
http.request(req)
|
||||
}
|
||||
return JSON.parse(res.body)
|
||||
end
|
Reference in New Issue
Block a user