Skip to content

valerius257/ansible-jenkins-restore-configuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Restore Jenkins Configuration from SCM

This role can be used to save or restore Jenkins configuration from SCM.

Requirements

  • Ansible 2.4
  • Jenkins with the scm-sync-configuration plugin.
  • Git installed and configured.

Parameters

  • JENKINS_URL: URL where Jenkins is available.
  • JENKINS_ADMIN_USERNAME, JENKINS_ADMIN_PASSWORD: username and password for Jenkins admin user.
  • JENKINS_SCMSYNC_URL: repository where Jenkins configuration is stored. Right now only Git repositories are supported with the following limitations:
  • JENKINS_SCMSYNC_MESSAGE_PATTERN: pattern for commit messages.
  • JENKINS_SCMSYNC_ADDITIONAL_INCLUDES: list of files to additionally include to the repository. Credentials and secret files are already included in jenkins_scmsync_default_includes variable.

Example

- hosts: jenkins
  vars:
    JENKINS_PORT: 8080
    JENKINS_URL: "http://{{ inventory_hostname }}:{{ JENKINS_PORT }}"
    JENKINS_ADMIN_USERNAME: admin
    JENKINS_ADMIN_PASSWORD: securePassword
    JENKINS_PLUGINS:
      - scm-sync-configuration

    JENKINS_SCMSYNC_URL: https://user:pass@git.example.com/jenkins-conf.git
    JENKINS_SCMSYNC_ADDITIONAL_INCLUDES:
      - custom/*
      - com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig.xml
      - org.jenkins.plugins.lockableresources.LockableResourcesManager.xml
      - xml-config-files.xml

  roles:
    - role: jenkins
    - role: valerius257.jenkins-restore-configuration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published