While setting custom workspace path for windows slave, if windows style slashes (\
) are used, script is throwing errors
ansible 2.9.11
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/avlab/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.12 (default, Apr 15 2020, 17:07:12) [GCC 5.4.0 20160609]
DEFAULT_ASK_PASS(env: ANSIBLE_ASK_PASS) = True
DEFAULT_BECOME_ASK_PASS(env: ANSIBLE_BECOME_ASK_PASS) = True
DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = [u'/etc/ansible/roles', u'/home/avlab/.ansible/roles']
HOST_KEY_CHECKING(env: ANSIBLE_HOST_KEY_CHECKING) = False
TASK [lean_delivery.jenkins_slave : Install slave jenkins agent] ********************************************************************************************************************************************************
task path: /home/avlab/.ansible/roles/lean_delivery.jenkins_slave/tasks/Win32NT/agent.yml:2
File lookup using /home/avlab/.ansible/roles/lean_delivery.jenkins_slave/templates/add_windows_slave.groovy.j2 as file
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: avlab
<localhost> EXEC /bin/sh -c 'echo ~avlab && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/avlab/.ansible/tmp `"&& mkdir /home/avlab/.ansible/tmp/ansible-tmp-1613679479.49-1662-269814171562223 && echo ansible-tmp-1613679479.49-1662-269814171562223="` echo /home/avlab/.ansible/tmp/ansible-tmp-1613679479.49-1662-269814171562223 `" ) && sleep 0'
Using module file /home/avlab/.ansible/roles/lean_delivery.jenkins_slave/library/jenkins_script.py
<localhost> PUT /home/avlab/.ansible/tmp/ansible-local-1626bSTEeT/tmpXd0jF2 TO /home/avlab/.ansible/tmp/ansible-tmp-1613679479.49-1662-269814171562223/AnsiballZ_jenkins_script.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/avlab/.ansible/tmp/ansible-tmp-1613679479.49-1662-269814171562223/ /home/avlab/.ansible/tmp/ansible-tmp-1613679479.49-1662-269814171562223/AnsiballZ_jenkins_script.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /home/avlab/.ansible/tmp/ansible-tmp-1613679479.49-1662-269814171562223/AnsiballZ_jenkins_script.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/avlab/.ansible/tmp/ansible-tmp-1613679479.49-1662-269814171562223/ > /dev/null 2>&1 && sleep 0'
fatal: [Dev0016627.esri.com]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"args": null,
"force_basic_auth": true,
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"script": "import jenkins.model.*\nimport hudson.model.*\nimport hudson.slaves.*\nimport hudson.slaves.EnvironmentVariablesNodeProperty.Entry\n\nList<Entry> env = new ArrayList<Entry>();\nEnvironmentVariablesNodeProperty envPro = new EnvironmentVariablesNodeProperty(env);\n\nComputerLauncher launcher = new JNLPLauncher()\nSlave slave = new DumbSlave(\"node-Dev0016627\",\n \"C:\\Jenkins_Slave\",\n launcher)\nslave.numExecutors = 1\nslave.labelString = \"windows\"\nslave.mode = Node.Mode.EXCLUSIVE\nslave.retentionStrategy = new RetentionStrategy.Always()\nslave.getNodeProperties().add(envPro)\nJenkins.instance.addNode(slave)\nprint slave.getComputer().getJnlpMac()\n",
"timeout": 40,
"url": "http://release_tests:8080",
"url_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"url_username": "skarumuri",
"user": "skarumuri",
"validate_certs": false
}
},
"msg": "script failed with stacktrace:\n org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:\nScript1.groovy: 11: unexpected char: '\\' @ line 11, column 32.\n \"C:\\Jenkins_Slave\",\n ^\n\n1 error\n\n\tat org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)\n\tat org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:150)\n\tat org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:120)\n\tat org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:132)\n\tat org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:350)\n\tat org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:139)\n\tat org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:110)\n\tat org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:234)\n\tat org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:168)\n\tat org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:943)\n\tat org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:605)\n\tat org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)\n\tat org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)\n\tat groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)\n\tat groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)\n\tat groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)\n\tat groovy.lang.GroovyShell.parse(GroovyShell.java:700)\n\tat groovy.lang.GroovyShell.evaluate(GroovyShell.java:584)\n\tat groovy.lang.GroovyShell.evaluate(GroovyShell.java:623)\n\tat groovy.lang.GroovyShell.evaluate(GroovyShell.java:594)\n\tat hudson.util.RemotingDiagnostics$Script.call(RemotingDiagnostics.java:142)\n\tat hudson.util.RemotingDiagnostics$Script.call(RemotingDiagnostics.java:114)\n\tat hudson.remoting.LocalChannel.call(LocalChannel.java:45)\n\tat hudson.util.RemotingDiagnostics.executeGroovy(RemotingDiagnostics.java:111)\n\tat jenkins.model.Jenkins._doScript(Jenkins.java:4513)\n\tat jenkins.model.Jenkins.doScriptText(Jenkins.java:4491)\n\tat java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)\n\tat org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)\n\tat org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)\n\tat org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)\n\tat org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)\n\tat org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:535)\n\tat org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)\n\tat org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)\n\tat org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)\n\tat org.kohsuke.stapler.Stapler.invoke(Stapler.java:676)\n\tat org.kohsuke.stapler.Stapler.service(Stapler.java:238)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)\n\tat jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:76)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)\n\tat com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:47)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)\n\tat jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:128)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)\n\tat hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:153)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)\n\tat hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat jenkins.security.BasicHeaderProcessor.success(BasicHeaderProcessor.java:139)\n\tat jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:82)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)\n\tat hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)\n\tat hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:36)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1300)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1215)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:500)\n\tat org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)\n\tat org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)\n\tat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)\n\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)\n\tat java.lang.Thread.run(Thread.java:748)\n",
"output": ""
}