I am working on a project to deploy the jenkins CI server on centos7 using the indispensable And I am having problems creating jenkins jobs from an xml template using the irreplaceable.
Everything works fine so far, but now I want to be able to create tasks and give them the basic configuration from an xml file using unsible. My solution was the following command from jenkins-cli:
sudo java -jar jenkins-cli.jar -s http://localhost:8080 create-job Job_test1 < Job_test1.xml
this works fine when entered manually in the centos7 field, but when I put it in the indispensable and run it:
- name: create jenkins jobs with xml files sudo: yes command: "java -jar {{ jenkins.cli_dest }} -s http://localhost:8080 create-job {{ item.name }} < {{ jenkins_dest }}/{{ item.xml_name }}" with_items: jenkins_jobs
The following error message appears:
stderr: Too many arguments: < java -jar jenkins-cli.jar create-job NAME Creates a new job by reading stdin as a configuration XML file.
Does anyone know about this? As far as I can see, I am doing it right (since the command works when it is not entered without help)
source share