Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #14 from escoem/JENKINS-42445
[JENKINS-42445] Support hostKeyChecking = true in pipeline dsl
  • Loading branch information
escoem committed Oct 30, 2017
2 parents f930ff8 + 99484a7 commit 00002d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Expand Up @@ -71,6 +71,7 @@ public class AnsiblePlaybookStep extends AbstractStepImpl {
private String extras = null;
private boolean colorized = false;
private int forks = 0;
private boolean hostKeyChecking = false;

@DataBoundConstructor
public AnsiblePlaybookStep(String playbook) {
Expand Down Expand Up @@ -152,6 +153,11 @@ public void setForks(int forks) {
this.forks = forks;
}

@DataBoundSetter
public void setHostKeyChecking(boolean hostKeyChecking) {
this.hostKeyChecking = hostKeyChecking;
}

public String getInstallation() {
return installation;
}
Expand Down Expand Up @@ -208,14 +214,18 @@ public String getExtras() {
return extras;
}

public boolean isColorized() {
return colorized;
public boolean isHostKeyChecking() {
return hostKeyChecking;
}

public int getForks() {
return forks;
}

public boolean isColorized() {
return colorized;
}

@Extension
public static final class DescriptorImpl extends AbstractStepDescriptorImpl {

Expand Down Expand Up @@ -320,7 +330,7 @@ protected Void run() throws Exception {
builder.setSkippedTags(step.getSkippedTags());
builder.setExtraVars(convertExtraVars(step.extraVars));
builder.setAdditionalParameters(step.getExtras());
builder.setHostKeyChecking(false);
builder.setHostKeyChecking(step.isHostKeyChecking());
builder.setUnbufferedOutput(true);
builder.setColorizedOutput(step.isColorized());
Node node;
Expand Down
Expand Up @@ -33,6 +33,9 @@
<f:entry field="forks" title="Number of parallel processes to use">
<f:textbox/>
</f:entry>
<f:entry title="${%Check host SSH key}" field="hostKeyChecking">
<f:checkbox default="false" />
</f:entry>
<f:entry field="colorized" title="${%Colorized output}">
<f:checkbox default="false" />
</f:entry>
Expand Down

0 comments on commit 00002d7

Please sign in to comment.