minion1:
hostname: minion1
osName: Windows
!!python/unicode 'username': !!python/unicode 'pluto'
This is the corresponding errors from rundeck logs:
Caused by: com.dtolabs.rundeck.core.resources.ResourceModelSourceException: com.dtolabs.rundeck.core.resources.format.ResourceFormatParserException: com.dtolabs.rundeck.core.common.NodeFileParserException: could not determine a constructor for the tag tag:yaml.org,2002:python/unicode
in 'reader', line 12, column 3:
!!python/unicode 'username': !!p ...
^
at com.dtolabs.rundeck.core.resources.BaseFileResourceModelSource.loadNodes(BaseFileResourceModelSource.java:277)
at com.dtolabs.rundeck.core.resources.BaseFileResourceModelSource.getNodes(BaseFileResourceModelSource.java:253)
at com.dtolabs.rundeck.core.resources.BaseFileResourceModelSource.getNodes(BaseFileResourceModelSource.java:236)
at com.dtolabs.rundeck.core.resources.FileResourceModelSource.parseFile(FileResourceModelSource.java:249)
at com.dtolabs.rundeck.core.resources.ScriptResourceUtil.executeScript(ScriptResourceUtil.java:152)
at com.dtolabs.rundeck.core.resources.ScriptResourceModelSource.getNodes(ScriptResourceModelSource.java:156)
... 47 more
Caused by: com.dtolabs.rundeck.core.resources.format.ResourceFormatParserException: com.dtolabs.rundeck.core.common.NodeFileParserException: could not determine a constructor for the tag tag:yaml.org,2002:python/unicode
in 'reader', line 12, column 3:
!!python/unicode 'username': !!p ...
^
at com.dtolabs.rundeck.core.resources.format.ResourceYamlFormatParser.parseDocument(ResourceYamlFormatParser.java:90)
at com.dtolabs.rundeck.core.resources.BaseFileResourceModelSource.loadNodes(BaseFileResourceModelSource.java:271)
... 52 more
Caused by: com.dtolabs.rundeck.core.common.NodeFileParserException: could not determine a constructor for the tag tag:yaml.org,2002:python/unicode
in 'reader', line 12, column 3:
!!python/unicode 'username': !!p ...
^
Obviously I shouldn't get this '!!python/unicode' prefix...
I can work around it by remarking the following lines:
Hi,
First - thank you for this script, really great work and very good instructions!
Second, I'm having some issues with '-s' flag and with static attributes option. I'm using Python version 2.7.5 on centos 7
When running the script with -s and/or username=XXX I'm getting the following out put from the script
This is my command:
sudo /rundeck/scripts/SaltGenResource.py -s -G 'kernel:windows' username=XXX
this is the result for the rundeck server (-s)
This is from some minion:
This is the corresponding errors from rundeck logs:
Obviously I shouldn't get this '!!python/unicode' prefix... I can work around it by remarking the following lines:
and by adding the username hard coded in the script, but thought maybe you have an easy fix for this.