Skip to content

Commit

Permalink
Merge pull request #394 from rundeck-plugins/RUN-2888
Browse files Browse the repository at this point in the history
RUN-2888: Support windows authentication
  • Loading branch information
ltamaster authored Oct 15, 2024
2 parents 56ef33a + 44c297c commit bafa421
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: get_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
- name: Upload plugin jar
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v4
with:
# Artifact name
name: Grails-Plugin-${{ steps.get_version.outputs.VERSION }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class BasicIntegrationSpec extends BaseTestConfiguration {
ansibleNodeExecutionStatus.get("failed")==0
ansibleNodeExecutionStatus.get("skipped")==0
ansibleNodeExecutionStatus.get("ignored")==0
logs.findAll {it.log.contains("encryptVariable ansible_ssh_password:")}.size() == 1
logs.findAll {it.log.contains("encryptVariable ansible_password:")}.size() == 1
}

def "test simple inline playbook private-key with passphrase authentication"(){
Expand Down Expand Up @@ -301,7 +301,7 @@ class BasicIntegrationSpec extends BaseTestConfiguration {
ansibleNodeExecutionStatus.get("failed")==0
ansibleNodeExecutionStatus.get("skipped")==0
ansibleNodeExecutionStatus.get("ignored")==0
logs.findAll {it.log.contains("encryptVariable ansible_ssh_password:")}.size() == 1
logs.findAll {it.log.contains("encryptVariable ansible_password:")}.size() == 1
logs.findAll {it.log.contains("\"environmentTest\": \"test\"")}.size() == 1
logs.findAll {it.log.contains("\"token\": 13231232312321321321321")}.size() == 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public static String[] getValues() {
.title("SSH Key File path")
.description("File Path to the SSH Key to use")
.renderingOption(StringRenderingConstants.GROUPING,"SECONDARY")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Connection")
.renderingOption(StringRenderingConstants.GROUP_NAME,"Authentication")
.build();


Expand All @@ -366,50 +366,50 @@ public static String[] getValues() {
.renderingOption(StringRenderingConstants.STORAGE_PATH_ROOT_KEY, "keys")
.renderingOption(StringRenderingConstants.STORAGE_FILE_META_FILTER_KEY, "Rundeck-key-type=private")
.renderingOption(StringRenderingConstants.GROUPING,"SECONDARY")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Connection")
.renderingOption(StringRenderingConstants.GROUP_NAME,"Authentication")
.build();

static final Property SSH_PASSWORD_STORAGE_PROP = PropertyBuilder.builder()
.string(ANSIBLE_SSH_PASSWORD_STORAGE_PATH)
.required(false)
.title("SSH Password Storage Path")
.description("Path to the ssh Password to use within Rundeck Storage.")
.title("Password Storage Path")
.description("Path to the Password to use within Rundeck Storage.")
.renderingOption(StringRenderingConstants.SELECTION_ACCESSOR_KEY,
StringRenderingConstants.SelectionAccessor.STORAGE_PATH)
.renderingOption(StringRenderingConstants.STORAGE_PATH_ROOT_KEY, "keys")
.renderingOption(StringRenderingConstants.STORAGE_FILE_META_FILTER_KEY, "Rundeck-data-type=password")
.renderingOption(StringRenderingConstants.GROUPING,"SECONDARY")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Connection")
.renderingOption(StringRenderingConstants.GROUP_NAME,"Authentication")
.build();

static final Property SSH_PASSWORD_PROP = PropertyBuilder.builder()
.string(ANSIBLE_SSH_PASSWORD)
.required(false)
.title("SSH Password")
.description("Ansible SSH password.")
.title("User Password")
.description("Ansible User Password.")
.renderingOption(StringRenderingConstants.DISPLAY_TYPE_KEY,
StringRenderingConstants.DisplayType.PASSWORD)
.renderingOption(StringRenderingConstants.GROUPING,"SECONDARY")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Connection")
.renderingOption(StringRenderingConstants.GROUP_NAME,"Authentication")
.build();

static final Property SSH_AUTH_TYPE_PROP = PropertyBuilder.builder()
.select(ANSIBLE_SSH_AUTH_TYPE)
.required(false)
.title("SSH Authentication")
.description("Type of SSH Authentication to use.")
.title("Authentication Type")
.description("Type of Authentication to use.")
.values(Arrays.asList(AuthenticationType.getValues()))
.renderingOption(StringRenderingConstants.GROUPING,"SECONDARY")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Connection")
.renderingOption(StringRenderingConstants.GROUP_NAME,"Authentication")
.build();

static final Property SSH_USER_PROP = PropertyBuilder.builder()
.string(ANSIBLE_SSH_USER)
.required(false)
.title("SSH User")
.description("SSH User to authenticate as (default=rundeck).")
.title("User")
.description("User to authenticate as (default=rundeck).")
.renderingOption(StringRenderingConstants.GROUPING,"SECONDARY")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Connection")
.renderingOption(StringRenderingConstants.GROUP_NAME,"Authentication")
.build();

static final Property SSH_TIMEOUT_PROP = PropertyBuilder.builder()
Expand All @@ -418,7 +418,7 @@ public static String[] getValues() {
.title("SSH Timeout")
.description("SSH timeout, override the SSH timeout in seconds (default=10).")
.renderingOption(StringRenderingConstants.GROUPING,"SECONDARY")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Connection")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Extra Configuration")
.build();

static final Property SSH_USE_AGENT = PropertyBuilder.builder()
Expand All @@ -427,7 +427,7 @@ public static String[] getValues() {
.title("Use ssh-agent.")
.description("Use ssh-agent to connect with a private key plus a passphrase.")
.renderingOption(StringRenderingConstants.GROUPING,"SECONDARY")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Connection")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Extra Configuration")
.build();

static final Property SSH_PASSPHRASE = PropertyBuilder.builder()
Expand All @@ -440,7 +440,7 @@ public static String[] getValues() {
.renderingOption(StringRenderingConstants.STORAGE_PATH_ROOT_KEY, "keys")
.renderingOption(StringRenderingConstants.STORAGE_FILE_META_FILTER_KEY, "Rundeck-data-type=password")
.renderingOption(StringRenderingConstants.GROUPING,"SECONDARY")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Connection")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Extra Configuration")
.build();

static final Property SSH_PASSPHRASE_OPTION = PropertyBuilder.builder()
Expand All @@ -450,7 +450,7 @@ public static String[] getValues() {
.description("SSH Passphrase from secure option on a job, it just works if the ssh-agent is used.")
.defaultValue(DEFAULT_ANSIBLE_SSH_PASSPHRASE_OPTION)
.renderingOption(StringRenderingConstants.GROUPING,"SECONDARY")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Connection")
.renderingOption(StringRenderingConstants.GROUP_NAME,"SSH Extra Configuration")
.build();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public int run() throws Exception {
}

if (sshUsePassword) {
String extraVarsPassword = "ansible_ssh_password: " + sshPass;
String extraVarsPassword = "ansible_password: " + sshPass;
String finalextraVarsPassword = extraVarsPassword;

if(useAnsibleVault){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class AnsibleFileCopier implements FileCopier, AnsibleDescribable, ProxyR
builder.property(INVENTORY_INLINE_PROP);
builder.property(CONFIG_FILE_PATH);
builder.property(SSH_AUTH_TYPE_PROP);
builder.property(SSH_USER_PROP);
builder.property(SSH_USER_PROP);
builder.property(SSH_PASSWORD_STORAGE_PROP);
builder.property(SSH_KEY_FILE_PROP);
builder.property(SSH_KEY_STORAGE_PROP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ public AnsibleResourceModelSourceFactory(final Framework framework) {
builder.property(SSH_AUTH_TYPE_PROP);
builder.property(SSH_USER_PROP);
builder.property(SSH_PASSWORD_PROP);
builder.property(SSH_PASSWORD_STORAGE_PROP);
builder.property(SSH_KEY_FILE_PROP);
builder.property(SSH_KEY_STORAGE_PROP);

builder.property(SSH_TIMEOUT_PROP);
builder.property(BECOME_PROP);
builder.property(BECOME_AUTH_TYPE_PROP);
Expand All @@ -57,10 +60,7 @@ public AnsibleResourceModelSourceFactory(final Framework framework) {
builder.property(VAULT_PASSWORD_PROP);
builder.property(VAULT_KEY_STORAGE_PROP);

builder.property(SSH_PASSWORD_STORAGE_PROP);
builder.property(SSH_KEY_STORAGE_PROP);
builder.property(SSH_PASSPHRASE);

builder.property(SSH_USE_AGENT);
builder.property(BECOME_PASSWORD_STORAGE_PROP);

Expand Down

0 comments on commit bafa421

Please sign in to comment.