All Projects → geerlingguy → Ansible Role Jenkins

geerlingguy / Ansible Role Jenkins

Licence: mit
Ansible Role - Jenkins CI

Programming Languages

groovy
2714 projects

Projects that are alternatives of or similar to Ansible Role Jenkins

Nevergreen
🐤 A build monitor with attitude
Stars: ✭ 170 (-75.33%)
Mutual labels:  ci, continuous-integration, jenkins
Bzppx Codepub
暴走皮皮虾之代码发布系统,是现代的持续集成发布系统,由后台管理系统和agent两部分组成,一个运行着的agent就是一个节点,本系统并不是造轮子,是"鸟枪"到"大炮"的创新,对"前朝遗老"的革命.
Stars: ✭ 471 (-31.64%)
Mutual labels:  ci, continuous-integration, jenkins
Jenkins Rest
Java client, built on top of jclouds, for working with Jenkins REST API
Stars: ✭ 201 (-70.83%)
Mutual labels:  ci, continuous-integration, jenkins
Ci Detector
Detect continuous integration environment and get information of current build
Stars: ✭ 138 (-79.97%)
Mutual labels:  ci, continuous-integration, jenkins
Env Ci
Get environment variables exposed by CI services
Stars: ✭ 180 (-73.88%)
Mutual labels:  ci, continuous-integration, jenkins
jenkinsapi
A Python API for accessing resources and configuring Hudson & Jenkins continuous-integration servers
Stars: ✭ 790 (+14.66%)
Mutual labels:  jenkins, continuous-integration, ci
Ccmenu
CCMenu is a Mac application to monitor continuous integration servers.
Stars: ✭ 306 (-55.59%)
Mutual labels:  ci, continuous-integration, jenkins
Php Censor
PHP Censor is an open source self-hosted continuous integration server for PHP projects.
Stars: ✭ 619 (-10.16%)
Mutual labels:  ci, continuous-integration
Pipeline
Pipeline is a package to build multi-staged concurrent workflows with a centralized logging output.
Stars: ✭ 433 (-37.16%)
Mutual labels:  ci, jenkins
Newman
Newman is a command-line collection runner for Postman
Stars: ✭ 5,607 (+713.79%)
Mutual labels:  ci, jenkins
Gitlab Ci Pipeline Php
☕️ Docker images for test PHP applications with Gitlab CI (or any other CI platform!)
Stars: ✭ 451 (-34.54%)
Mutual labels:  ci, continuous-integration
Ansible Role Gitlab
Ansible Role - GitLab
Stars: ✭ 459 (-33.38%)
Mutual labels:  ansible, role
Xcov
Nice code coverage reporting without hassle
Stars: ✭ 467 (-32.22%)
Mutual labels:  ci, continuous-integration
Lambdacd
a library to define a continuous delivery pipeline in code
Stars: ✭ 655 (-4.93%)
Mutual labels:  ci, continuous-integration
Ansible Role Security
Ansible Role - Security
Stars: ✭ 398 (-42.24%)
Mutual labels:  ansible, role
Gojenkins
Jenkins API Client in Go. Looking for maintainers to move this project forward.
Stars: ✭ 594 (-13.79%)
Mutual labels:  continuous-integration, jenkins
Semaphore
Modern UI for Ansible
Stars: ✭ 4,588 (+565.89%)
Mutual labels:  ansible, ci
Ansible Role Php
Ansible Role - PHP
Stars: ✭ 396 (-42.53%)
Mutual labels:  ansible, role
Dotci
DotCi Jenkins github integration, .ci.yml http://groupon.github.io/DotCi
Stars: ✭ 505 (-26.71%)
Mutual labels:  continuous-integration, jenkins
Buildbot
Python-based continuous integration testing framework; your pull requests are more than welcome!
Stars: ✭ 4,735 (+587.23%)
Mutual labels:  ci, continuous-integration

Ansible Role: Jenkins CI

CI

Installs Jenkins CI on RHEL/CentOS and Debian/Ubuntu servers.

Requirements

Requires curl to be installed on the server. Also, newer versions of Jenkins require Java 8+ (see the test playbooks inside the molecule/default directory for an example of how to use newer versions of Java for your OS).

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

jenkins_package_state: present

The state of the jenkins package install. By default this role installs Jenkins but will not upgrade Jenkins (when using package-based installs). If you want to always update to the latest version, change this to latest.

jenkins_hostname: localhost

The system hostname; usually localhost works fine. This will be used during setup to communicate with the running Jenkins instance via HTTP requests.

jenkins_home: /var/lib/jenkins

The Jenkins home directory which, amongst others, is being used for storing artifacts, workspaces and plugins. This variable allows you to override the default /var/lib/jenkins location.

jenkins_http_port: 8080

The HTTP port for Jenkins' web interface.

jenkins_admin_username: admin
jenkins_admin_password: admin

Default admin account credentials which will be created the first time Jenkins is installed.

jenkins_admin_password_file: ""

Default admin password file which will be created the first time Jenkins is installed as /var/lib/jenkins/secrets/initialAdminPassword

jenkins_jar_location: /opt/jenkins-cli.jar

The location at which the jenkins-cli.jar jarfile will be kept. This is used for communicating with Jenkins via the CLI.

jenkins_plugins:
  - blueocean
  - name: influxdb
    version: "1.12.1"

Jenkins plugins to be installed automatically during provisioning. Defaults to empty list ([]). Items can use name or dictionary with name and version keys to pin specific version of a plugin.

jenkins_plugins_install_dependencies: true

Whether Jenkins plugins to be installed should also install any plugin dependencies.

jenkins_plugins_state: present

Use latest to ensure all plugins are running the most up-to-date version. For any plugin that has a specific version set in jenkins_plugins list, state present will be used instead of jenkins_plugins_state value.

jenkins_plugin_updates_expiration: 86400

Number of seconds after which a new copy of the update-center.json file is downloaded. Set it to 0 if no cache file should be used.

jenkins_updates_url: "https://updates.jenkins.io"

The URL to use for Jenkins plugin updates and update-center information.

jenkins_plugin_timeout: 30

The server connection timeout, in seconds, when installing Jenkins plugins.

jenkins_version: "2.220"
jenkins_pkg_url: "http://www.example.com"

(Optional) Then Jenkins version can be pinned to any version available on http://pkg.jenkins-ci.org/debian/ (Debian/Ubuntu) or http://pkg.jenkins-ci.org/redhat/ (RHEL/CentOS). If the Jenkins version you need is not available in the default package URLs, you can override the URL with your own; set jenkins_pkg_url (Note: the role depends on the same naming convention that http://pkg.jenkins-ci.org/ uses).

jenkins_url_prefix: ""

Used for setting a URL prefix for your Jenkins installation. The option is added as --prefix={{ jenkins_url_prefix }} to the Jenkins initialization java invocation, so you can access the installation at a path like http://www.example.com{{ jenkins_url_prefix }}. Make sure you start the prefix with a / (e.g. /jenkins).

jenkins_connection_delay: 5
jenkins_connection_retries: 60

Amount of time and number of times to wait when connecting to Jenkins after initial startup, to verify that Jenkins is running. Total time to wait = delay * retries, so by default this role will wait up to 300 seconds before timing out.

jenkins_prefer_lts: false

By default, this role will install the latest version of Jenkins using the official repositories according to the platform. You can install the current LTS version instead by setting this to false.

The default repositories (listed below) can be overridden as well.

# For RedHat/CentOS:
jenkins_repo_url: https://pkg.jenkins.io/redhat{{ '-stable' if (jenkins_prefer_lts | bool) else '' }}/jenkins.repo
jenkins_repo_key_url: https://pkg.jenkins.io/redhat{{ '-stable' if (jenkins_prefer_lts | bool) else '' }}/jenkins.io.key

# For Debian/Ubuntu:
jenkins_repo_url: deb https://pkg.jenkins.io/debian{{ '-stable' if (jenkins_prefer_lts | bool) else '' }} binary/
jenkins_repo_key_url: https://pkg.jenkins.io/debian{{ '-stable' if (jenkins_prefer_lts | bool) else '' }}/jenkins.io.key

It is also possible to prevent the repo file from being added by setting jenkins_repo_url: ''. This is useful if, for example, you sign your own packages or run internal package management (e.g. Spacewalk).

jenkins_java_options: "-Djenkins.install.runSetupWizard=false"

Extra Java options for the Jenkins launch command configured in the init file can be set with the var jenkins_java_options. For example, if you want to configure the timezone Jenkins uses, add -Dorg.apache.commons.jelly.tags.fmt.timeZone=America/New_York. By default, the option to disable the Jenkins 2.0 setup wizard is added.

jenkins_init_changes:
  - option: "JENKINS_ARGS"
    value: "--prefix={{ jenkins_url_prefix }}"
  - option: "JENKINS_JAVA_OPTIONS"
    value: "{{ jenkins_java_options }}"

Changes made to the Jenkins init script; the default set of changes set the configured URL prefix and add in configured Java options for Jenkins' startup. You can add other option/value pairs if you need to set other options for the Jenkins init file.

jenkins_proxy_host: ""
jenkins_proxy_port: ""
jenkins_proxy_noproxy:
  - "127.0.0.1"
  - "localhost"

If you are running Jenkins behind a proxy server, configure these options appropriately. Otherwise Jenkins will be configured with a direct Internet connection.

Dependencies

None.

Example Playbook

- hosts: jenkins
  become: true
  
  vars:
    jenkins_hostname: jenkins.example.com
    java_packages:
      - openjdk-8-jdk

  roles:
    - role: geerlingguy.java
    - role: geerlingguy.jenkins

Note that java_packages may need different versions depending on your distro (e.g. openjdk-11-jdk for Debian 10, or java-1.8.0-openjdk for RHEL 7 or 8).

License

MIT (Expat) / BSD

Author Information

This role was created in 2014 by Jeff Geerling, author of Ansible for DevOps.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].