Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ jobs:
lint-unit:
uses: sous-chefs/.github/.github/workflows/lint-unit.yml@6.0.0
permissions:
actions: write
checks: write
pull-requests: write
statuses: write
issues: write

integration:
needs: lint-unit
Expand All @@ -25,16 +23,16 @@ jobs:
os:
- "almalinux-8"
- "almalinux-9"
- "centos-7"
- "centos-stream-8"
- "amazonlinux-2023"
- "centos-stream-9"
- "debian-10"
- "debian-11"
- "debian-12"
- "fedora-latest"
- "oraclelinux-8"
- "oraclelinux-9"
- "rockylinux-8"
- "rockylinux-9"
- "ubuntu-1804"
- "ubuntu-2004"
- "ubuntu-2204"
- "ubuntu-2404"
suite:
- "default"
fail-fast: false
Expand All @@ -43,7 +41,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v6
- name: Install Chef
uses: actionshub/chef-install@6.0.0
uses: sous-chefs/.github/.github/actions/install-workstation@6.0.0
- name: Dokken
uses: actionshub/test-kitchen@3.0.0
env:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/prevent-file-change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ name: prevent-file-change
jobs:
prevent-file-change:
uses: sous-chefs/.github/.github/workflows/prevent-file-change.yml@6.0.0
permissions:
pull-requests: write
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ jobs:
token: ${{ secrets.PORTER_GITHUB_TOKEN }}
supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }}
supermarket_key: ${{ secrets.CHEF_SUPERMARKET_KEY }}
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel_id: ${{ secrets.SLACK_CHANNEL_ID }}
4 changes: 3 additions & 1 deletion Berksfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

source 'https://supermarket.chef.io'

metadata

group :integration do
cookbook 'test', path: 'test/fixtures/cookbooks/test'
cookbook 'test', path: 'test/cookbooks/test'
end
53 changes: 53 additions & 0 deletions LIMITATIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Limitations

## Package Availability

This cookbook configures packagecloud.io repositories. It does not install
packagecloud.io itself and does not build packages.

packagecloud.io documents repository support for RPM, DEB, Debian source,
RubyGems, Python, Node.js, Alpine, Maven, Helm, and generic files. The
`packagecloud_repo` resource manages only APT/DEB, YUM/DNF/RPM, and RubyGems
repository sources.

### APT (Debian/Ubuntu)

* packagecloud supports DEB repositories, including `any/any` repositories for
packages that work across Debian-based distributions.
* This cookbook tests Debian 12 and Ubuntu 22.04/24.04.
* EOL Debian and Ubuntu releases were removed from the supported platform and
Kitchen matrices.

### DNF/YUM (RHEL family)

* packagecloud supports RPM repositories, including `rpm_any/rpm_any`
repositories for packages that work across RPM-based distributions.
* This cookbook tests AlmaLinux 8/9, Amazon Linux 2023, CentOS Stream 9,
Fedora latest, Oracle Linux 8/9, and Rocky Linux 8/9.
* EOL CentOS Linux 7, CentOS Stream 8, Oracle Linux 7, and Scientific Linux were
removed from the supported platform and Kitchen matrices.

### Zypper (SUSE)

* The existing resource does not implement SUSE/Zypper repository management.
openSUSE Leap was removed from Kitchen because the resource type default only
maps Debian, RHEL, Fedora, and Amazon platform families.

## Architecture Limitations

Architecture availability is determined by the packages uploaded to each
packagecloud repository. The cookbook writes repository configuration and does
not constrain package architectures.

## Source/Compiled Installation

No source or compiled installation path is managed by this cookbook.

## Known Issues

* Private RubyGems repository removal can only remove sources that can be
matched from the configured packagecloud repository URL; packagecloud read
tokens may differ between runs.
* APT repository installation still uses the legacy `apt-key` command because
that is the behavior exposed by the existing resource and packagecloud
repository install flow.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

This cookbook provides a resource for installing <https://packagecloud.io> repositories.

## Migration

This cookbook no longer provides node attributes. See [migration.md](migration.md)
for the breaking changes and resource property replacements.

## Usage

## Resources
Expand Down
5 changes: 0 additions & 5 deletions attributes/default.rb

This file was deleted.

91 changes: 50 additions & 41 deletions documentation/packagecloud_repo.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,79 @@
# `pacakgecloud_repo`

The packagecloud_repo resource manages the installation of package repositories on various systems, including Debian, RHEL, Fedora, and Amazon Linux. It supports deb, rpm, and gem package types.
Properties

The following table provides an overview of the available properties for packagecloud_repo:

| Property | Type | Description | Default |
|-----------------|---------|------------------------------------------------------------------------------------------------|---------------------------|
| repository | String | The name of the repository to install. | |
| master_token | String | The master token for the repository. This is only required for private repositories. | |
| force_os | String | The OS to force for the repository. This is only required for some repositories. | |
| force_dist | String | The distribution to force for the repository. This is only required for some repositories. | |
| type | String | The type of repository to install. Valid values are `deb`, `rpm`, and `gem`. | |
| base_url | String | The base URL for the repository. This is only required for packagecloud:enterprise users. | `https://packagecloud.io` |
| priority | Integer | The priority of the repository. This is only required for Debian-based systems. | false |
| metadata_expire | String | The metadata expiration time for the repository. This is only required for RHEL-based systems. | 300 |
# packagecloud_repo

Manages packagecloud.io APT, YUM/DNF, and RubyGems repository sources.

## Actions

| Action | Description |
|-----------|-----------------------------------------------|
| `:add` | Adds the repository source. Default action. |
| `:remove` | Removes the repository source where possible. |

## Properties

| Property | Type | Default | Description |
|---------------------|------------------------------|---------------------------|------------------------------------------------------------------|
| `repository` | String | name property | packagecloud repository path, such as `owner/repository`. |
| `master_token` | String | `nil` | Master token for private repositories. |
| `force_os` | String | `nil` | Override the detected packagecloud OS name. |
| `force_dist` | String | `nil` | Override the detected packagecloud distribution name. |
| `type` | String | platform family default | Repository type: `deb`, `rpm`, or `gem`. |
| `base_url` | String | `https://packagecloud.io` | Base URL for packagecloud Enterprise installs. |
| `base_repo_path` | String | `/install/repositories/` | packagecloud install API path. |
| `gpg_key_path` | String | `/gpgkey` | packagecloud GPG key path retained for wrapper compatibility. |
| `hostname_override` | String, nil | `nil` | Hostname sent to packagecloud when Ohai cannot determine one. |
| `proxy_host` | String, nil | `nil` | Proxy host used for packagecloud API requests. |
| `proxy_port` | String, Integer, nil | `nil` | Proxy port used for packagecloud API requests. |
| `priority` | Integer, true, false | `false` | Optional YUM repository priority. |
| `metadata_expire` | String | `300` | YUM metadata expiration value. |

## Examples

### Public repository

```ruby
packagecloud_repo "computology/packagecloud-cookbook-test" do
type "deb"
end
packagecloud_repo 'computology/packagecloud-cookbook-test-public'
```

### Public Repository
### Private repository

```ruby
packagecloud_repo "computology/packagecloud-cookbook-test-public"
packagecloud_repo 'computology/packagecloud-cookbook-test-private' do
master_token '762748f7ae0bfdb086dd539575bdc8cffdca78c6a9af0db9'
end
```

### Private Repositories

For private repositories, you need to supply a `master_token`:
### packagecloud Enterprise

```ruby
packagecloud_repo "computology/packagecloud-cookbook-test-private" do
master_token "762748f7ae0bfdb086dd539575bdc8cffdca78c6a9af0db9"
packagecloud_repo 'computology/packagecloud-cookbook-test-private' do
base_url 'https://packages.example.com'
master_token '762748f7ae0bfdb086dd539575bdc8cffdca78c6a9af0db9'
end
```

### Enterprise Users

For packagecloud:enterprise users, add `base_url` to your resource:
### Force OS and distribution

```ruby
packagecloud_repo "computology/packagecloud-cookbook-test-private" do
base_url "https://packages.example.com"
master_token "762748f7ae0bfdb086dd539575bdc8cffdca78c6a9af0db9"
packagecloud_repo 'computology/packagecloud-cookbook-test-public' do
force_os 'rhel'
force_dist '9'
end
```

### Force OS and Dist

For forcing the os and dist for repository install:
### Proxy packagecloud API requests

```ruby
packagecloud_repo 'computology/packagecloud-cookbook-test-public' do
force_os 'rhel'
force_dist '6.5'
proxy_host 'myproxy.organization.com'
proxy_port '80'
end
```

This cookbook performs checks to determine if a package exists before attempting to install it. To enable proxy support _for these checks_ (not to be confused with proxy support for your package manager of choice), add the following attributes to your cookbook:
### Remove a repository

```ruby
default['packagecloud']['proxy_host'] = 'myproxy.organization.com'
default['packagecloud']['proxy_port'] = '80'
packagecloud_repo 'computology/packagecloud-cookbook-test-public' do
action :remove
end
```
57 changes: 8 additions & 49 deletions kitchen.dokken.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
driver:
name: dokken
privileged: true
chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>

transport: { name: dokken }
provisioner: { name: dokken }
transport:
name: dokken

provisioner:
name: dokken

platforms:
- name: almalinux-8
Expand All @@ -22,36 +26,11 @@ platforms:
image: dokken/amazonlinux-2023
pid_one_command: /usr/lib/systemd/systemd

- name: centos-7
driver:
image: dokken/centos-7
pid_one_command: /usr/lib/systemd/systemd

- name: centos-stream-8
driver:
image: dokken/centos-stream-8
pid_one_command: /usr/lib/systemd/systemd

- name: centos-stream-9
driver:
image: dokken/centos-stream-9
pid_one_command: /usr/lib/systemd/systemd

- name: debian-9
driver:
image: dokken/debian-9
pid_one_command: /bin/systemd

- name: debian-10
driver:
image: dokken/debian-10
pid_one_command: /bin/systemd

- name: debian-11
driver:
image: dokken/debian-11
pid_one_command: /bin/systemd

- name: debian-12
driver:
image: dokken/debian-12
Expand All @@ -62,16 +41,6 @@ platforms:
image: dokken/fedora-latest
pid_one_command: /usr/lib/systemd/systemd

- name: opensuse-leap-15
driver:
image: dokken/opensuse-leap-15
pid_one_command: /usr/lib/systemd/systemd

- name: oraclelinux-7
driver:
image: dokken/oraclelinux-7
pid_one_command: /usr/lib/systemd/systemd

- name: oraclelinux-8
driver:
image: dokken/oraclelinux-8
Expand All @@ -92,22 +61,12 @@ platforms:
image: dokken/rockylinux-9
pid_one_command: /usr/lib/systemd/systemd

- name: ubuntu-18.04
driver:
image: dokken/ubuntu-18.04
pid_one_command: /bin/systemd

- name: ubuntu-20.04
driver:
image: dokken/ubuntu-20.04
pid_one_command: /bin/systemd

- name: ubuntu-22.04
driver:
image: dokken/ubuntu-22.04
pid_one_command: /bin/systemd

- name: ubuntu-23.04
- name: ubuntu-24.04
driver:
image: dokken/ubuntu-23.04
image: dokken/ubuntu-24.04
pid_one_command: /bin/systemd
7 changes: 0 additions & 7 deletions kitchen.exec.yml

This file was deleted.

11 changes: 1 addition & 10 deletions kitchen.global.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,12 @@ platforms:
- name: almalinux-8
- name: almalinux-9
- name: amazonlinux-2023
- name: centos-7
- name: centos-stream-8
- name: centos-stream-9
- name: debian-9
- name: debian-10
- name: debian-11
- name: debian-12
- name: fedora-latest
- name: opensuse-leap-15
- name: oraclelinux-7
- name: oraclelinux-8
- name: oraclelinux-9
- name: rockylinux-8
- name: rockylinux-9
- name: ubuntu-18.04
- name: ubuntu-20.04
- name: ubuntu-22.04
- name: ubuntu-23.04
- name: ubuntu-24.04
Loading
Loading