-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #399 from rundeck-plugins/issue/rpl-29_ansible-yam…
…l-error-format RPL-29: Fix - Ansible YAML parsing error
- Loading branch information
Showing
7 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
functional-test/src/test/groovy/functional/YamlParsingSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package functional | ||
|
||
import functional.base.BaseTestConfiguration | ||
import org.testcontainers.spock.Testcontainers | ||
|
||
@Testcontainers | ||
class YamlParsingSpec extends BaseTestConfiguration { | ||
|
||
static String PROJ_NAME = 'ansible-yaml-parsing' | ||
static String NODE_1 = 'server1' | ||
static String NODE_2 = 'server2' | ||
|
||
def setupSpec() { | ||
startCompose() | ||
configureRundeck(PROJ_NAME, 'server1') | ||
} | ||
|
||
void "hide warnings"() { | ||
when: | ||
def result = client.apiCall {api-> api.listNodes(PROJ_NAME,'.*')} | ||
|
||
then: | ||
result != null | ||
result.size() == 3 | ||
result.get(NODE_1) != null | ||
result.get(NODE_1).getAttributes().get("ansible_host") == "192.168.1.10" | ||
result.get(NODE_1).getAttributes().get("ansible_user") == "user2" | ||
result.get(NODE_1).getAttributes().get("http_port") == "8080" | ||
result.get(NODE_2) != null | ||
result.get(NODE_2).getAttributes().get("ansible_host") == "192.168.1.20" | ||
result.get(NODE_2).getAttributes().get("ansible_user") == "user3" | ||
result.get(NODE_2).getAttributes().get("http_port") == "8080" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
functional-test/src/test/resources/docker/ansible-yaml-parsing/ansible.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[defaults] | ||
inventory=/home/rundeck/ansible-yaml-parsing/inventory_duplicate_key.yaml | ||
interpreter_python=/usr/bin/python3 | ||
|
||
|
||
|
16 changes: 16 additions & 0 deletions
16
functional-test/src/test/resources/docker/ansible-yaml-parsing/inventory_duplicate_key.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
all: | ||
hosts: | ||
server1: | ||
ansible_host: 192.168.1.10 | ||
ansible_user: user1 | ||
# Duplicate key! | ||
ansible_user: user2 # This will cause the warning | ||
|
||
server2: | ||
ansible_host: 192.168.1.20 | ||
ansible_user: user3 | ||
|
||
vars: | ||
http_port: 80 | ||
# Another duplicate key! | ||
http_port: 8080 # This will also cause the warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...es/project-import/ansible-yaml-parsing/rundeck-yaml-parsing/files/acls/node-acl.aclpolicy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
by: | ||
urn: project:ansible-yaml-parsing | ||
for: | ||
storage: | ||
- match: | ||
path: 'keys/.*' | ||
allow: [read] | ||
description: Allow access to key storage |
31 changes: 31 additions & 0 deletions
31
...ces/project-import/ansible-yaml-parsing/rundeck-yaml-parsing/files/etc/project.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#edit below | ||
project.disable.executions=false | ||
project.disable.schedule=false | ||
project.execution.history.cleanup.batch=500 | ||
project.execution.history.cleanup.enabled=false | ||
project.execution.history.cleanup.retention.days=60 | ||
project.execution.history.cleanup.retention.minimum=50 | ||
project.execution.history.cleanup.schedule=0 0 0 1/1 * ? * | ||
project.jobs.gui.groupExpandLevel=1 | ||
project.later.executions.disable.value=0 | ||
project.later.executions.disable=false | ||
project.later.executions.enable.value= | ||
project.later.executions.enable=false | ||
project.later.schedule.disable.value= | ||
project.later.schedule.disable=false | ||
project.later.schedule.enable.value= | ||
project.later.schedule.enable=false | ||
project.name=ansible-yaml-parsing | ||
project.nodeCache.enabled=false | ||
project.nodeCache.firstLoadSynch=true | ||
project.output.allowUnsanitized=false | ||
project.retry-counter=3 | ||
project.ssh-authentication=privateKey | ||
resources.source.1.type=local | ||
resources.source.2.config.ansible-config-file-path=/home/rundeck/ansible-yaml-parsing/ansible.cfg | ||
resources.source.2.config.ansible-gather-facts=false | ||
resources.source.2.config.ansible-ignore-errors=true | ||
resources.source.2.config.ansible-inventory=/home/rundeck/ansible-yaml-parsing/inventory_duplicate_key.yaml | ||
resources.source.2.type=com.batix.rundeck.plugins.AnsibleResourceModelSourceFactory | ||
service.FileCopier.default.provider=sshj-scp | ||
service.NodeExecutor.default.provider=sshj-ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters