{"id":13780705,"url":"https://github.com/sous-chefs/jenkins","last_synced_at":"2025-04-13T01:59:14.167Z","repository":{"id":6705461,"uuid":"7950974","full_name":"sous-chefs/jenkins","owner":"sous-chefs","description":"Development repository for the jenkins cookbook","archived":false,"fork":false,"pushed_at":"2025-03-17T22:39:47.000Z","size":54248,"stargazers_count":425,"open_issues_count":49,"forks_count":636,"subscribers_count":83,"default_branch":"main","last_synced_at":"2025-04-06T00:03:40.194Z","etag":null,"topics":["chef","chef-cookbook","chef-resource","hacktoberfest","jenkins","managed-by-terraform"],"latest_commit_sha":null,"homepage":"https://supermarket.chef.io/cookbooks/jenkins","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sous-chefs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"sous-chefs"}},"created_at":"2013-02-01T03:23:46.000Z","updated_at":"2025-03-17T16:37:45.000Z","dependencies_parsed_at":"2024-02-26T23:04:56.968Z","dependency_job_id":"21623af8-0450-481d-bc27-ce1c370edffe","html_url":"https://github.com/sous-chefs/jenkins","commit_stats":{"total_commits":1046,"total_committers":187,"mean_commits":5.593582887700535,"dds":0.8680688336520077,"last_synced_commit":"df74c6e94579be46f1a3a4fddfbe729e9a3cdc44"},"previous_names":[],"tags_count":182,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fjenkins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fjenkins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fjenkins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fjenkins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sous-chefs","download_url":"https://codeload.github.com/sous-chefs/jenkins/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317703,"owners_count":21083528,"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":["chef","chef-cookbook","chef-resource","hacktoberfest","jenkins","managed-by-terraform"],"created_at":"2024-08-03T18:01:18.937Z","updated_at":"2025-04-13T01:59:14.142Z","avatar_url":"https://github.com/sous-chefs.png","language":"Ruby","funding_links":["https://opencollective.com/sous-chefs"],"categories":["Cookbooks"],"sub_categories":["Web Applications"],"readme":"# jenkins Cookbook\n\n[![Cookbook Version](https://img.shields.io/cookbook/v/jenkins.svg)](https://supermarket.chef.io/cookbooks/jenkins)\n[![CI State](https://github.com/sous-chefs/jenkins/workflows/ci/badge.svg)](https://github.com/sous-chefs/jenkins/actions?query=workflow%3Aci)\n[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers)\n[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)\n[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)\n\nInstalls and configures Jenkins CI master \u0026 node slaves. Resource providers to support automation via jenkins-cli, including job create/update.\n\n## Maintainers\n\nThis cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit [sous-chefs.org](https://sous-chefs.org/) or come chat with us on the Chef Community Slack in [#sous-chefs](https://chefcommunity.slack.com/messages/C2V7B88SF).\n\n## Requirements\n\n### Platforms\n\n- Debian 9+\n- Ubuntu 18.04+\n- RHEL/CentOS 7+\n\n### Chef\n\n- Chef 13.0+\n\n#### Java cookbook\n\nThis cookbook does not install, manage, or manipulate a JDK, as that is outside of the scope of Jenkins. The `package` installation method will automatically pull in a valid Java if one does not exist on Debian. RHEL jenkins packages do not depend on java as there are far too many options for a package to do the right thing. We recommend including the java cookbook on your system which allows for either openJDK or Oracle JDK installations.\n\n## Attributes\n\nIn order to keep the README manageable and in sync with the attributes, this cookbook documents attributes inline. The usage instructions and default values for attributes can be found in the individual attribute files.\n\n## Examples\n\nDocumentation and examples are provided inline using YARD. The tests and fixture cookbooks in `tests` and `tests/fixtures` are intended to be a further source of examples.\n\n## Recipes\n\n### master\n\nThe master recipe will create the required directory structure and install jenkins. There are two installation methods, controlled by the `node['jenkins']['master']['install_method']` attribute:\n\n- `package` - Install Jenkins from the official jenkins-ci.org packages\n- `war` - Download the latest version of the WAR file and configure a systemd service\n\n## Resources\n\n- [jenkins_command](./documentation/jenkins_command.md)\n- [jenkins_credentials](./documentation/jenkins_credentials.md)\n- [jenkins_job](./documentation/jenkins_job.md)\n- [jenkins_password_credentials](./documentation/jenkins_password_credentials.md)\n- [jenkins_plugin](./documentation/jenkins_plugin.md)\n- [jenkins_private_key_credentials](./documentation/jenkins_private_key_credentials.md)\n- [jenkins_proxy](./documentation/jenkins_proxy.md)\n- [jenkins_script](./documentation/jenkins_script.md)\n- [jenkins_secret_text_credentials](./documentation/jenkins_secret_text_credentials.md)\n- [jenkins_slave](./documentation/jenkins_slave.md)\n- [jenkins_user](./documentation/jenkins_user.md)\n- [jenkins_view](./documentation/jenkins_view.md)\n\n## Caveats\n\n### Authentication\n\nIf you use or plan to use authentication for your Jenkins cluster (which we highly recommend), you will need to set a special value in the `run_context`:\n\n```ruby\nnode.run_state[:jenkins_private_key]\n```\n\nThe underlying executor class (which all HWRPs use) intelligently adds authentication information to the Jenkins CLI commands if this value is set. The method used to generate and populate this key-pair is left to the user:\n\n```ruby\n# Using search\nmaster = search(:node, 'fqdn:master.ci.example.com').first\nnode.run_state[:jenkins_private_key] = master['jenkins']['private_key']\n\n# Using encrypted data bags and chef-sugar\nprivate_key = encrypted_data_bag_item('jenkins', 'keys')['private_key']\nnode.run_state[:jenkins_private_key] = private_key\n```\n\nThe associated public key must be set on a Jenkins user. You can use the `jenkins_user` resource to create this pairing. Here's an example that loads a keypair and assigns it appropriately:\n\n```ruby\njenkins_keys = encrypted_data_bag_item('jenkins', 'keys')\n\nrequire 'openssl'\nrequire 'net/ssh'\n\nkey = OpenSSL::PKey::RSA.new(jenkins_keys['private_key'])\nprivate_key = key.to_pem\npublic_key = \"#{key.ssh_type} #{[key.to_blob].pack('m0')}\"\n\n# Create the Jenkins user with the public key\njenkins_user 'chef' do\n  public_keys [public_key]\nend\n\n# Set the private key on the Jenkins executor\nnode.run_state[:jenkins_private_key] = private_key\n```\n\nPlease note that older versions of Jenkins (\u003c 1.555) permitted login via CLI for a user defined in Jenkins configuration with an SSH public key but not present in the actual SecurityRealm, and this is no longer permitted. If an operation requires any special permission at all, you must authenticate as a real user. This means that if you have LDAP or GitHub OAuth based authn/authz enabled the user you are using for configuration tasks must have an associated account in the external services. Please see [JENKINS-22346](https://issues.jenkins-ci.org/browse/JENKINS-22346) for more details.\n\nIf (and **only if**) you have your Jenkins instance configured to use the PAM (Unix user/group database) security realm you can set the username and password the CLI uses via these two `run_context` values:\n\n```ruby\nnode.run_state[:jenkins_username]\nnode.run_state[:jenkins_password]\n```\n\n### Jenkins 2\n\nJenkins 2 enables an install wizard by default. To make sure you can manipulate the jenkins instance, you need to disable the wizard. You can do this by setting an attribute:\n\n```ruby\ndefault['jenkins']['master']['jvm_options'] = '-Djenkins.install.runSetupWizard=false'\n```\n\nThis is done by default, but must be kept when overriding the jvm_options!\n\n### Proxies\n\nIf you need to pass through a proxy to communicate between your masters and slaves, you will need to set a special node attribute:\n\n```ruby\nnode['jenkins']['executor']['proxy']\n```\n\nThe underlying executor class (which all HWRPs use) intelligently passes proxy information to the Jenkins CLI commands if this attribute is set. It should be set in the form `HOST:PORT`:\n\n```ruby\nnode.normal['jenkins']['executor']['proxy'] = '1.2.3.4:5678'\n```\n\n## Development\n\nPlease see the [Contributing](CONTRIBUTING.md) and [Testing](TESTING.md) Guidelines.\n\n## Contributors\n\nThis project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890\u0026button=false)\n\n### Backers\n\nThank you to all our backers!\n\n![https://opencollective.com/sous-chefs#backers](https://opencollective.com/sous-chefs/backers.svg?width=600\u0026avatarHeight=40)\n\n### Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website.\n\n![https://opencollective.com/sous-chefs/sponsor/0/website](https://opencollective.com/sous-chefs/sponsor/0/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/1/website](https://opencollective.com/sous-chefs/sponsor/1/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/2/website](https://opencollective.com/sous-chefs/sponsor/2/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/3/website](https://opencollective.com/sous-chefs/sponsor/3/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/4/website](https://opencollective.com/sous-chefs/sponsor/4/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/5/website](https://opencollective.com/sous-chefs/sponsor/5/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/6/website](https://opencollective.com/sous-chefs/sponsor/6/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/7/website](https://opencollective.com/sous-chefs/sponsor/7/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/8/website](https://opencollective.com/sous-chefs/sponsor/8/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/9/website](https://opencollective.com/sous-chefs/sponsor/9/avatar.svg?avatarHeight=100)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsous-chefs%2Fjenkins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsous-chefs%2Fjenkins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsous-chefs%2Fjenkins/lists"}