Hello everyone,
I checked Ansible documentation, I did not find answers there or anywhere of how I can pass params to the Jenkins Job,so these params should be as an input params to this Jenkins Job and they will be used in that Job, So is there a way to make this happen?
Thank you already for your answers
In order to push jobs from Ansible or even Python to Jenkins you need to make sure Remote Trigger is enable and an API Token has been created for your Jenkins User. You can Then just use a Post request using the Ansible URI module
Hi,
In order to push jobs from Ansible or even Python to Jenkins you need to make sure Remote Trigger is enable and an API Token has been created for your Jenkins User. You can Then just use a Post request using the Ansible URI module
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/81063e55-65f0-487d-9953-03a2cd19b00c%40googlegroups.com.
Using the Example Curl -X you can use the Ansible URI Modulecurl -X POST http://developer:developer@localhost:8080/job/test/buildWithParameter --data-urlencode json='{"parameter": [{"name":"paramA", "value":"123"}]}'--- - name: Jenkins Remote Build hosts: localhost connection: local tasks: - name: Adding Virtual Machine to Blackout uri: url: http://developer:developer@localhost:8080/job/test/buildWithParameter method: POST body_format: JSON body: "{\"parameter\":[{\"name\":\"Test\"},{\"vaule\":\"123\"}]}status_code: 200