In my Jenkins pipeline, I launch a AWX job template with the option --monitor, the main goal being able to follow in Jenkins console what's going on in AWX.
sh ("awx --conf.insecure --conf.host ${ansibleUrl} --conf.username ${ANSIBLE_USERNAME} --conf.password ${ANSIBLE_PASSWORD} job_templates launch --extra_vars @ansible_extra_vars_file.json --monitor $ANSIBLE_JOB_TEMPLATE_ID ")
A similar post about running an ansible playbook via a shell script in jenkins pipeline had been made. However, the solution proposed does not solve my pb as I did not set returnStdout: true anyway.
The log is displayed in the Jenkins log console only when the Ansible job is completed.
When I launch the "awx job_templates launch" command directly from the Jenkins slave, the log is displayed in real time in the stdout.
How can I have the stdout being updated in real time in the Jenkins log console ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…