jenkins job config.xml

66 views
Skip to first unread message

Narmada Karthika

unread,
Jun 16, 2023, 7:40:24 PM6/16/23
to Ansible Project
I have a jenkins job config.xml file, this is the template file, which will be replaced with the values from another yml file and next it has to create a jenkins job out of it.  I am trying to figure out the best way to replace the values with the values from pipleine.yml file. could some one suggest better options. 

Dick Visser

unread,
Jun 17, 2023, 3:34:17 AM6/17/23
to ansible...@googlegroups.com
On Sat, 17 Jun 2023 at 01:40, Narmada Karthika <chitt...@gmail.com> wrote:
I have a jenkins job config.xml file, this is the template file, which will be replaced with the values from another yml file and next it has to create a jenkins job out of it.  I am trying to figure out the best way to replace the values with the values from pipleine.yml file. could some one suggest better options. 

--
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/7f6ddd96-2464-4ce4-ab00-f99f996c89bbn%40googlegroups.com.
--
Sent from Gmail Mobile

Narmada Karthika

unread,
Jun 19, 2023, 6:05:47 PM6/19/23
to Ansible Project
Thank you, by using the above module I am able to  replace with the required value in one location, what if I want to replace with my required value in other locations in the same config.xml file?

Abhijeet Kasurde

unread,
Jun 19, 2023, 6:40:04 PM6/19/23
to ansible...@googlegroups.com
Please use template module - https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_module.html to create a new pipeline.yml and then create jobs accordingly.



--
Thanks,
Abhijeet Kasurde
Message has been deleted

Narmada Karthika

unread,
Jun 21, 2023, 5:37:03 PM6/21/23
to Ansible Project
Thankyou Abhijeet, template module helped solve my issue. But as of now I am passing variables as --extra-vars to the command but I am looking for something where I can pass those variables with in the playbook instead of passing them manually.
the variables are output of above task in the same playbook.

Reply all
Reply to author
Forward
0 new messages