sous-chefs / jenkins

Development repository for the jenkins cookbook
https://supermarket.chef.io/cookbooks/jenkins
Apache License 2.0
424 stars 635 forks source link

Guidance on Managing Server and Plugin Configuration #687

Closed kbrowns closed 4 years ago

kbrowns commented 6 years ago

Cookbook version

6.0.0

Chef-client version

12.21.3

Platform Details

AWS Linux 2

Scenario:

Would like guidance on the best way to manage server level and plugin level (say LDAP) configuration on the master with this cookbook. I'm not finding any exposed means for setting up values in the config.xml file on the master. In past lives when I've written the automation from scratch, I template or poke the config.xml file directly. Is that the recommended way to do this while using this cookbook?

espoelstra commented 6 years ago

@kbrowns The "best" way to do this varies, but I've found using Groovy snippets via jenkins_script or dropping them into $JENKINS_HOME/init.groovy.d/some-config-bit.groovy to get processed on Jenkins startup to be effective. The only downside of the latter is you need to make sure the scripts don't require additional restarts of Jenkins or it can get tricky to track that state. Both methods can be challenging in that the scripts should be 'idempotent' ie they can be run multiple times but only make changes once otherwise your service might restart every time it converges.

kbrowns commented 6 years ago

@espolestra thank you for your response. We’ve found jenkins_script to be a very effective way to do this

wosc commented 5 years ago

Depending on how complex your needs are, https://github.com/jenkinsci/configuration-as-code-plugin seems to work quite well for adjusting configuration values from deployed yaml files (but I've only really done simple things so far with it, so cannot give an universal endorsement).

github-actions[bot] commented 4 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

github-actions[bot] commented 4 years ago

Closing due to inactivity. If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.