API call to "Save" Configure Tools and/or System

Jenkins setup:
2.504.2

Various plugins installed, like Maven, NodeJS, Groovy, Allure, etc

After restarting or reloading Jenkins, the default xml files for Maven, NodeJS, etc are not created.
These plugin specific default XML files are only created when you press Apply or Save while inside Jenkins (manual action, ewww)

Is there a way to use an api call to “Save” or “Apply” inside “configureTools” without actually manually going there?
This because we fully want to automate a installation of Jenkins (via Ansible), including all it’s plugins and non-default configurations

I think it is the wrong approach to try to configure Jenkins while it is online via ansible.
What you should do is either use Configuration as Code plugin or you just save the xml files and copy them via ansible to JENKINS_HOME before you start Jenkins.

I started to create the default xml files myself in Ansible as templates
Of course using existing ones as a base

1 Like