-
Improvement
-
Resolution: Fixed
-
Minor
-
None
Currently it isn't possible to set the forks paramter to an empty value.
Use case:
If you want a consistent forks value for your playbooks runs, you set the forks value in a ansible.cfg file.
This value isn't used for playbook runs by the ansible plugin, because it always adds the '-f' parameter with the forks value to the command.
It would be great if you would change the behaviour so that the '-f' option isn't passed to the ansible command if forks is empty.
This would give you playbook runs with a consistent forks value if you run the playbook on your workstation (wich respects ansible.cfg forks values) and if you run you playbook with jenkins and the ansible plugin (which currently not respect the ansible.cfg forks value).
Code changed in jenkins
User: Jean-Christophe Sirot
Path:
src/main/java/org/jenkinsci/plugins/ansible/AbstractAnsibleInvocation.java
src/main/java/org/jenkinsci/plugins/ansible/AnsibleAdHocCommandBuilder.java
src/main/java/org/jenkinsci/plugins/ansible/AnsiblePlaybookBuilder.java
src/main/java/org/jenkinsci/plugins/ansible/workflow/AnsiblePlaybookStep.java
src/main/resources/org/jenkinsci/plugins/ansible/AnsibleAdHocCommandBuilder/help-forks.html
src/main/resources/org/jenkinsci/plugins/ansible/AnsiblePlaybookBuilder/help-forks.html
src/test/java/org/jenkinsci/plugins/ansible/AnsibleAdHocCommandInvocationTest.java
http://jenkins-ci.org/commit/ansible-plugin/281162c0d1ffa5f36dc925611fdec9d8fb7c3cee
Log:
JENKINS-39438Do not append -f flag to command when forks is 0. Set default forks value to 0 in standard job and pipeline.