-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
ubuntu 20.04
python 3.10
java openjdk 11.0.11
jenkins 2.303.1
ansible 2.11.3
all installed on the single ubuntu machine. No additional Nodes.
When the first stage of a newly created pipeline is ansiblePlaybook the workspace is not created and the pipeline fails immediately with "workspace does not exist"
Preceeding this first stage with an arbitrary stage that forces a workspace to be created alleviates this issue.
Repro steps
Create new pipeline with never before used name: I.e. "Pipelineforansiblestage1test"
pipeline {
agent any
environment
stages {
stage('winrm') {
steps { ansiblePlaybook( playbook: '/data/ansible/ansiblemaster/winrm_prep.yml', inventory: '$jenkinsrawlist,', extras: '-e \"windows_username=$win_creds_USR windows_password=$win_creds_PSW ansible_username=$win_creds_USR\"') }
}
}
notice that this job fails with error no workspace exists.
WORKAROUND:
pipeline {
agent any
environment{ win_creds = credentials('jenkinswincreds') }
stages {
stage('Opening Workspace') {
steps {
script
}
}
stage('winrm') {
steps
}
The above job succeeds as the writefile stage creates a workspace.