From 47ef2fb98810c71034a53f93e52c6fc262abae2a Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Tue, 2 Apr 2019 15:37:33 -0400 Subject: [PATCH] Allow registration failures Allow registration failures, controlled by attribute, to prevent any upstream issues with the registration API from failing Chef runs. Signed-off-by: Chris Gianelloni --- attributes/default.rb | 3 +++ recipes/gateway.rb | 1 + recipes/relay.rb | 1 + recipes/server.rb | 1 + 4 files changed, 6 insertions(+) diff --git a/attributes/default.rb b/attributes/default.rb index 49dc5a5..216e72b 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -20,6 +20,9 @@ # Set this however you see fit default['strongdm']['admin_token'] = nil +# Allow failures to prevent failing Chef run +default['strongdm']['ignore_registration_failures'] = false + # Installation user default['strongdm']['url'] = 'https://app.strongdm.com/releases/cli/linux' default['strongdm']['user'] = 'strongdm' diff --git a/recipes/gateway.rb b/recipes/gateway.rb index cf3ec0d..181d5cf 100644 --- a/recipes/gateway.rb +++ b/recipes/gateway.rb @@ -26,5 +26,6 @@ bind_port node['strongdm']['gateway_bind_port'] port node['strongdm']['gateway_port'] user_name node['strongdm']['user'] + ignore_failure node['strongdm']['ignore_registration_failures'] action :create end diff --git a/recipes/relay.rb b/recipes/relay.rb index 0ab61da..bbb1c40 100644 --- a/recipes/relay.rb +++ b/recipes/relay.rb @@ -26,5 +26,6 @@ port node['strongdm']['relay_port'] user_name node['strongdm']['user'] type 'relay' + ignore_failure node['strongdm']['ignore_registration_failures'] action :create end diff --git a/recipes/server.rb b/recipes/server.rb index 5407ee2..66bcdc7 100644 --- a/recipes/server.rb +++ b/recipes/server.rb @@ -23,4 +23,5 @@ admin_token node['strongdm']['admin_token'] advertise_address node['ipaddress'] granted_roles node['strongdm']['default_grant_roles'] + ignore_failure node['strongdm']['ignore_registration_failures'] end