Skip to content

Commit

Permalink
Add documentation for the env prefix in package promises's options at…
Browse files Browse the repository at this point in the history
…tribute
  • Loading branch information
amousset committed Dec 19, 2024
1 parent fd69cbe commit d5a65f3
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions reference/promise-types/packages.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,28 @@ bundle agent example
screen-4.1.0-0.19.20120314git3c2946.el7.x86_64
```

* Supports [```options```][packages#options] attribute. Each space separate
option must be added as a separate list element. The options are passed
directly through to the package manager.
* It is possible to use the [```options```][packages#options] attribute to pass
environment variables to the package manager with the ```env``` prefix. For
example, to set the ```EXTERNAL_URL``` environment variable:

```cf3
bundle agent example_yum_pass_env_options
{
packages:
"gitlab-ce"
policy => "present",
options => { "env:EXTERNAL_URL=https://example.com" };
}
```

**History:**

* Added in CFEngine 3.7.0
* `enablerepo` and `disablerepo` option support added in 3.7.8, 3.10.4, 3.12.0
* ```env``` prefix ```options``` in support added in 3.21.7, 3.24.2 and 3.25.0

### apt_get

Expand Down Expand Up @@ -478,10 +496,21 @@ packages:
* Supports [```options```][packages#options] attribute. Each space separate
option must be added as a separate list element. The options are passed
directly through to the package manager.
* It is possible to use the [```options```][packages#options] attribute to pass
environment variables to the package manager with the ```env``` prefix. For
example, to set the ```EXTERNAL_URL``` environment variable:

```cf3
packages:
"gitlab-ce"
policy => "present",
options => { "env:EXTERNAL_URL=https://example.com" };
```

**History:**

* Added in CFEngine 3.7.0
* ```env``` prefix ```options``` in support added in 3.21.7, 3.24.2 and 3.25.0

### freebsd_ports

Expand Down Expand Up @@ -656,3 +685,57 @@ bundle agent main

- version `latest` is *not* supported when promising an absence
- `list-updates` is *not* implemented, snaps are automatically updated by default

### zypper

Manage packages using ```zypper```. This is the [default package module][lib/packages.cf#package_module_knowledge] for SLES, SLED and OpenSUSE.

**Examples:**

File based package source.

```cf3
packages:
sles|sled|opensuse::
"/mnt/nfs/packages/apache2-2.2.22.x86_64.rpm"
policy => "present";
```

Repository based package source with a specific version of the package.

```cf3
packages:
sles|sled|opensuse::
"apache2"
policy => "present",
version => "2.2.22";
```

**Notes:**

* Supports file path and repository sourced packages.

* Requires Python version 2 or 3 to be installed on the host.

* Supports [```options```][packages#options] attribute. Each space separate
option must be added as a separate list element. The options are passed
directly through to the package manager.
* It is possible to use the [```options```][packages#options] attribute to pass
environment variables to the package manager with the ```env``` prefix. For
example, to set the ```EXTERNAL_URL``` environment variable:

```cf3
bundle agent example_yum_pass_env_options
{
packages:
"gitlab-ce"
policy => "present",
options => { "env:EXTERNAL_URL=https://example.com" };
}
```

**History:**

* Added in CFEngine 3.11.0
* ```env``` prefix ```options``` in support added in 3.21.7, 3.24.2 and 3.25.0

0 comments on commit d5a65f3

Please sign in to comment.