From 9a3c46bc67e3c998ae3b4e1867259bf88e39a761 Mon Sep 17 00:00:00 2001 From: Pexers Date: Sat, 15 Jun 2024 18:04:50 +0100 Subject: [PATCH 1/2] Add support for Boolean extra-var interpretation Checks if extra variables are Boolean and, if so, applies a JSON format Closes #100 Signed-off-by: Pexers --- .../plugins/ansible/AbstractAnsibleInvocation.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jenkinsci/plugins/ansible/AbstractAnsibleInvocation.java b/src/main/java/org/jenkinsci/plugins/ansible/AbstractAnsibleInvocation.java index 0e67ee62..b5b5ed39 100644 --- a/src/main/java/org/jenkinsci/plugins/ansible/AbstractAnsibleInvocation.java +++ b/src/main/java/org/jenkinsci/plugins/ansible/AbstractAnsibleInvocation.java @@ -131,7 +131,17 @@ public ArgumentListBuilder appendExtraVars(ArgumentListBuilder args) { value = Util.singleQuote(value); } StringBuilder sb = new StringBuilder(); - sb.append(envVars.expand(var.getKey())).append("=").append(value); + // assuming Groovy representation for Boolean values + if (value.equals("true") || value.equals("false")) { + // JSON format is required for Boolean variables + sb.append("{\"") + .append(envVars.expand(var.getKey())) + .append("\":") + .append(value) + .append("}"); + } else { + sb.append(envVars.expand(var.getKey())).append("=").append(value); + } if (var.isHidden()) { args.addMasked(sb.toString()); } else { From 542ca858f45ec80ec146133d15a73031f1917787 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 06:32:25 +0000 Subject: [PATCH 2/2] Bump io.jenkins.tools.bom:bom-2.440.x Bumps [io.jenkins.tools.bom:bom-2.440.x](https://github.com/jenkinsci/bom) from 3120.v4d898e1e9fc4 to 3135.v6d6c1f6b_3572. - [Release notes](https://github.com/jenkinsci/bom/releases) - [Commits](https://github.com/jenkinsci/bom/commits) --- updated-dependencies: - dependency-name: io.jenkins.tools.bom:bom-2.440.x dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bc355a21..a6f84ac4 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ io.jenkins.tools.bom bom-2.440.x - 3120.v4d898e1e9fc4 + 3135.v6d6c1f6b_3572 pom import