{"id":13458464,"url":"https://github.com/geerlingguy/ansible-role-jenkins","last_synced_at":"2025-05-14T11:09:33.478Z","repository":{"id":14590522,"uuid":"17307266","full_name":"geerlingguy/ansible-role-jenkins","owner":"geerlingguy","description":"Ansible Role - Jenkins CI","archived":false,"fork":false,"pushed_at":"2025-01-30T03:39:35.000Z","size":246,"stargazers_count":841,"open_issues_count":11,"forks_count":753,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-04-03T20:52:52.065Z","etag":null,"topics":["ansible","ci","continuous-integration","jenkins","role"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/geerlingguy/jenkins/","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geerlingguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"geerlingguy","patreon":"geerlingguy"}},"created_at":"2014-03-01T03:58:08.000Z","updated_at":"2025-03-30T09:00:23.000Z","dependencies_parsed_at":"2023-02-18T05:05:35.625Z","dependency_job_id":"3a392f80-ba83-434d-94af-a4edb8b2f914","html_url":"https://github.com/geerlingguy/ansible-role-jenkins","commit_stats":{"total_commits":271,"total_committers":55,"mean_commits":4.927272727272728,"dds":0.3911439114391144,"last_synced_commit":"d929709489534ce848c9e35dde7da46c44515aa7"},"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fansible-role-jenkins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fansible-role-jenkins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fansible-role-jenkins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fansible-role-jenkins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geerlingguy","download_url":"https://codeload.github.com/geerlingguy/ansible-role-jenkins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339361,"owners_count":21087233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ci","continuous-integration","jenkins","role"],"created_at":"2024-07-31T09:00:52.840Z","updated_at":"2025-04-11T04:18:53.906Z","avatar_url":"https://github.com/geerlingguy.png","language":"Groovy","funding_links":["https://github.com/sponsors/geerlingguy","https://patreon.com/geerlingguy"],"categories":["References","Groovy","role","Version Control"],"sub_categories":["Do on your Jenkins controller machine","Other"],"readme":"# Ansible Role: Jenkins CI\n\n[![CI](https://github.com/geerlingguy/ansible-role-jenkins/actions/workflows/ci.yml/badge.svg)](https://github.com/geerlingguy/ansible-role-jenkins/actions/workflows/ci.yml)\n\nInstalls Jenkins CI on RHEL/CentOS and Debian/Ubuntu servers.\n\n## Requirements\n\nRequires `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).\n\n## Role Variables\n\nAvailable variables are listed below, along with default values (see `defaults/main.yml`):\n\n    jenkins_package_state: present\n\nThe 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`.\n\n    jenkins_hostname: localhost\n\nThe system hostname; usually `localhost` works fine. This will be used during setup to communicate with the running Jenkins instance via HTTP requests.\n\n    jenkins_home: /var/lib/jenkins\n\nThe 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.\n\n    jenkins_http_port: 8080\n\nThe HTTP port for Jenkins' web interface.\n\n    jenkins_admin_username: admin\n    jenkins_admin_password: admin\n\nDefault admin account credentials which will be created the first time Jenkins is installed.\n\n    jenkins_admin_password_file: \"\"\n\nDefault admin password file which will be created the first time Jenkins is installed as /var/lib/jenkins/secrets/initialAdminPassword\n\n    jenkins_jar_location: /opt/jenkins-cli.jar\n\nThe location at which the `jenkins-cli.jar` jarfile will be kept. This is used for communicating with Jenkins via the CLI.\n\n    jenkins_plugins:\n      - blueocean\n      - name: influxdb\n        version: \"1.12.1\"\n\nJenkins 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.\n\n    jenkins_plugins_install_dependencies: true\n\nWhether Jenkins plugins to be installed should also install any plugin dependencies.\n\n    jenkins_plugins_state: present\n\nUse `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.\n\n    jenkins_plugin_updates_expiration: 86400\n\nNumber 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.\n\n    jenkins_updates_url: \"https://updates.jenkins.io\"\n\nThe URL to use for Jenkins plugin updates and update-center information.\n\n    jenkins_plugin_timeout: 30\n\nThe server connection timeout, in seconds, when installing Jenkins plugins.\n\n    jenkins_version: \"2.346\"\n    jenkins_pkg_url: \"http://www.example.com\"\n\n(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).\n\n    jenkins_url_prefix: \"\"\n\nUsed 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`).\n\n    jenkins_connection_delay: 5\n    jenkins_connection_retries: 60\n\nAmount 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.\n\n    jenkins_prefer_lts: false\n\nBy 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`.\n\nThe default repositories (listed below) can be overridden as well.\n\n    # For RedHat/CentOS:\n    jenkins_repo_url: https://pkg.jenkins.io/redhat{{ '-stable' if (jenkins_prefer_lts | bool) else '' }}/jenkins.repo\n    jenkins_repo_key_url: https://pkg.jenkins.io/redhat{{ '-stable' if (jenkins_prefer_lts | bool) else '' }}/jenkins.io.key\n    \n    # For Debian/Ubuntu:\n    jenkins_repo_url: deb https://pkg.jenkins.io/debian{{ '-stable' if (jenkins_prefer_lts | bool) else '' }} binary/\n    jenkins_repo_key_url: https://pkg.jenkins.io/debian{{ '-stable' if (jenkins_prefer_lts | bool) else '' }}/jenkins.io.key\n\nIt 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).\n\n    jenkins_options: \"\"\n\nExtra options (e.g. setting the HTTP keep alive timeout) to pass to Jenkins on startup via `JENKINS_OPTS` in the systemd override.conf file can be configured using the var `jenkins_options`. By default, no options are specified.\n\n    jenkins_java_options: \"-Djenkins.install.runSetupWizard=false\"\n\nExtra Java options for the Jenkins launch command configured via `JENKINS_JAVA_OPTS` in the systemd override.conf 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.\n\n    jenkins_init_changes:\n      - option: \"JENKINS_OPTS\"\n        value: \"{{ jenkins_options }}\"\n      - option: \"JAVA_OPTS\"\n        value: \"{{ jenkins_java_options }}\"\n      - option: \"JENKINS_HOME\"\n        value: \"{{ jenkins_home }}\"\n      - option: \"JENKINS_PREFIX\"\n        value: \"{{ jenkins_url_prefix }}\"\n      - option: \"JENKINS_PORT\"\n        value: \"{{ jenkins_http_port }}\"\n\nChanges made to the Jenkins systemd override.conf file; the default set of changes set the configured URL prefix, Jenkins home directory, Jenkins port and adds the configured Jenkins and Java options for Jenkins' startup. You can add other option/value pairs if you need to set other options for the Jenkins systemd override.conf file.\n\n    jenkins_proxy_host: \"\"\n    jenkins_proxy_port: \"\"\n    jenkins_proxy_noproxy:\n      - \"127.0.0.1\"\n      - \"localhost\"\n\nIf you are running Jenkins behind a proxy server, configure these options appropriately. Otherwise Jenkins will be configured with a direct Internet connection.\n\n    jenkins_restart_method: `service`\n\nYou can change `jenkins_restart_method` to `safe-restart`, if you want to make sure all running jobs on the Jenkins server are completed. Otherwise `service` will restart the Jenkins systemd-service.\n\n## Dependencies\n\nNone.\n\n## Example Playbook\n\n```yaml\n- hosts: jenkins\n  become: true\n  \n  vars:\n    jenkins_hostname: jenkins.example.com\n    java_packages:\n      - openjdk-8-jdk\n\n  roles:\n    - role: geerlingguy.java\n    - role: geerlingguy.jenkins\n```\n\nNote 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).\n\n## License\n\nMIT (Expat) / BSD\n\n## Author Information\n\nThis role was created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerlingguy%2Fansible-role-jenkins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeerlingguy%2Fansible-role-jenkins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerlingguy%2Fansible-role-jenkins/lists"}