GithubHelp home page GithubHelp logo

classicvalues / ansible-role-jenkins-jcasc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ableton/ansible-role-jenkins-jcasc

1.0 1.0 0.0 302 KB

Ansible role for installing Jenkins with JCasC

License: MIT License

Python 74.26% Shell 11.18% Jinja 14.56%

ansible-role-jenkins-jcasc's Introduction

Ansible role ableton.jenkins_jcasc

This role provisions the Jenkins CI Service on a Unix host. It uses JCasC (Jenkins Configuration as Code) to configure the instance, and the Jenkins Plugin Installation Manager Tool to download Jenkins plugins and their respective dependencies. Generally speaking, this is much faster and more reliable than using Ansible's jenkins_plugin module or with API calls to a running instance of Jenkins.

Requirements

Ansible >= 2.9, and a target host which meets the following requirements:

  • Supports one of the following package managers:
    • apt
  • Supports one of the following service managers:
    • systemd
    • sysvinit

Additionally, you'll need a jenkins.yaml file for the Jenkins system configuration and a plugins.yaml file to specify the Jenkins plugins to install.

The jenkins.yaml configuration file can be generated from an existing Jenkins installation by performing the following steps:

  1. Install the JCasC plugin (and restart Jenkins)
  2. Navigate to the "Manage Jenkins" page
  3. Navigate to the"Configuration as Code" page under the "System Configuration" section
  4. On this page, there is a button under the "Actions" section labeled "Download Configuration", which generate a YAML file that can be used with this role

Please see the JCasC homepage for more details on this YAML file format.

As for the plugins.yaml file, please refer to the tool's homepage for information on this file's format. Alternately, the plugin data can be present in the jenkins.yaml file under the plugins section.

Both the jenkins.yaml and plugins.yaml files are treated as templates, so Jinja2 syntax can be used to customize them during provisioning.

Important: The plugins specified in the Gradle build.gradle file should be excluded from your plugins.yaml file to avoid potential conflicting versions. Please see the README.md file in the plugins directory for more information.

Role Variables

See the defaults/main.yml file for full documentation on required and optional role variables.

Example Playbook

This role requires root permissions for several tasks, so become: true must be applied either to the playbook, or to the individual role (as shown below).

---
- name: Provision Jenkins
  hosts: all
  vars:
    jenkins_java_args: "-server -Xmx2g -Xms512m"
    jenkins_jcasc_config_file: "jenkins.yaml.j2"
    jenkins_plugins_file: "plugins.yaml"
    jenkins_jobs:
      - "example_job"
    jenkins_jobs_dir: "{{ playbook_dir }}/files/jenkins/jobs"

  roles:
    - {role: ableton.jenkins_jcasc, become: true}

HTTPS

This role does not support HTTPS, due to the complexity of configuration. If HTTPS support is needed, the easiest way to add this is using an nginx proxy.

However, HTTP must be enabled to provision Jenkins with this role. In other words, you may not define jenkins_port to -1 to disable HTTP altogether. To provide a secure-only Jenkins service, you should instead use a proxy service for HTTPS (with nginx, for example), and firewall off HTTP traffic.

License

MIT

Maintainers

This project is maintained by the following GitHub users:

ansible-role-jenkins-jcasc's People

Contributors

nre-ableton avatar dependabot[bot] avatar mst-ableton avatar ala-ableton avatar rco-ableton avatar

Stargazers

Classic Values avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.