0
votes

I'm installing Jenkins 2, with all plugins using Ansible and I wan't to use SCM Sync configuration plugin [1] for managing Jenkins configuration. Is there a way to do SCM Sync configuration plugin reload [2] externally? I have tried Ansible URI module and also tried to use wget, problem seems to be that it does not authenticate.

[1] https://wiki.jenkins-ci.org/display/JENKINS/SCM+Sync+configuration+plugin

[2] http://password:username@jenkins_url/plugin/scm-sync-configuration/reloadAllFilesFromScm

1

1 Answers

1
votes

Try below steps,

  1. Install Jenkins and configure SCM sync plugin to include all the necessary Jenkins jobs/configuration that include scm sync plugin configuration too.
  2. When you are trying to extract in new instance/reload use "git archive ---" command in ansible playbook/role to extract and restart jenkins.
  3. Before step 2 make sure git config file and SSH Keys is configured for Jenkins user to Git account.