Browse Source

fix ansible errbit vars

tags/v0.8.0
Jonathan Cobb 4 years ago
parent
commit
4ed0cf708b
3 changed files with 11 additions and 9 deletions
  1. +3
    -3
      automation/roles/bubble/files/bubble_role.json
  2. +5
    -3
      bubble-server/src/main/java/bubble/service/cloud/AnsiblePrepService.java
  3. +3
    -3
      bubble-server/src/main/resources/ansible/default_roles.json

+ 3
- 3
automation/roles/bubble/files/bubble_role.json View File

@@ -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": ""

+ 5
- 3
bubble-server/src/main/java/bubble/service/cloud/AnsiblePrepService.java View File

@@ -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());
}



+ 3
- 3
bubble-server/src/main/resources/ansible/default_roles.json View File

@@ -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": ""


Loading…
Cancel
Save