diff --git a/automation/roles/bubble/files/bubble_role.json b/automation/roles/bubble/files/bubble_role.json index 5e586e28..1dcc540c 100644 --- a/automation/roles/bubble/files/bubble_role.json +++ b/automation/roles/bubble/files/bubble_role.json @@ -27,9 +27,9 @@ {"name": "restore_key", "value": "[[restoreKey]]"}, {"name": "restore_timeout", "value": "[[restoreTimeoutSeconds]]"}, {"name": "test_mode", "value": "[[testMode]]"}, - {"name": "errbit_url", "value": "[[#compare fork '==' true]][[configuration.errorApi.url]][[/compare]]"}, - {"name": "errbit_key", "value": "[[#compare fork '==' true]][[configuration.errorApi.key]][[/compare]]"}, - {"name": "errbit_env", "value": "[[#compare fork '==' true]][[node.fqdn]][[/compare]]"} + {"name": "errbit_url", "value": "[[errbit_url]]"}, + {"name": "errbit_key", "value": "[[errbit_key]]"}, + {"name": "errbit_env", "value": "[[errbit_env]]"} ], "optionalConfigNames": ["restore_key", "restore_timeout", "errbit_url", "errbit_key", "errbit_env"], "tgzB64": "" diff --git a/bubble-server/src/main/java/bubble/service/cloud/AnsiblePrepService.java b/bubble-server/src/main/java/bubble/service/cloud/AnsiblePrepService.java index b4de9887..09fbe83d 100644 --- a/bubble-server/src/main/java/bubble/service/cloud/AnsiblePrepService.java +++ b/bubble-server/src/main/java/bubble/service/cloud/AnsiblePrepService.java @@ -21,6 +21,7 @@ import org.cobbzilla.util.handlebars.HandlebarsUtil; import org.cobbzilla.util.io.Tarball; import org.cobbzilla.util.io.TempDir; import org.cobbzilla.util.string.Base64; +import org.cobbzilla.wizard.server.config.ErrorApiConfiguration; import org.cobbzilla.wizard.validation.ValidationResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -80,9 +81,10 @@ public class AnsiblePrepService { ctx.put("sslPort", network.getSslPort()); ctx.put("publicBaseUri", network.getPublicUri()); - if (network.sendMetrics()) { - ctx.put("errbit_url", configuration.getErrorApi().getUrl()); - ctx.put("errbit_key", configuration.getErrorApi().getKey()); + if (network.sendMetrics() && configuration.hasErrorApi()) { + final ErrorApiConfiguration errorApi = configuration.getErrorApi(); + ctx.put("errbit_url", errorApi.getUrl()); + ctx.put("errbit_key", errorApi.getKey()); ctx.put("errbit_env", node.getFqdn()); } diff --git a/bubble-server/src/main/resources/ansible/default_roles.json b/bubble-server/src/main/resources/ansible/default_roles.json index 2abce282..bfe33f21 100644 --- a/bubble-server/src/main/resources/ansible/default_roles.json +++ b/bubble-server/src/main/resources/ansible/default_roles.json @@ -48,9 +48,9 @@ {"name": "restore_key", "value": "[[restoreKey]]"}, {"name": "restore_timeout", "value": "[[restoreTimeoutSeconds]]"}, {"name": "test_mode", "value": "[[testMode]]"}, - {"name": "errbit_url", "value": "[[#compare fork '==' true]][[configuration.errorApi.url]][[/compare]]"}, - {"name": "errbit_key", "value": "[[#compare fork '==' true]][[configuration.errorApi.key]][[/compare]]"}, - {"name": "errbit_env", "value": "[[#compare fork '==' true]][[node.fqdn]][[/compare]]"} + {"name": "errbit_url", "value": "[[errbit_url]]"}, + {"name": "errbit_key", "value": "[[errbit_key]]"}, + {"name": "errbit_env", "value": "[[errbit_env]]"} ], "optionalConfigNames": ["restore_key", "restore_timeout", "errbit_url", "errbit_key", "errbit_env"], "tgzB64": ""