Packages

  • package.install

Package Providers

Packages is a group of actions that utilize the local system's package manager, however it is a bit special. Unlike some other actions, packages can also contain providers. Some operating systems may have multiple package managers available and providers allow the user to choose which package manager to use. For example, macOS will automatically utilize homebrew as the default package manager, but this default can be overridden for another package manager on the system such as pkgin, which also supports macOS, or macports.

Supported package providers

Not all package managers are supported. This is a list of currently supported package providers:

ProviderOS
pacman/yayArch
paruArch
aptDebian/Ubuntu
pkgFreeBSD
pkginNetBSD (Multiple)
brewmacOS
wingetWindows
xbpsVoid Linux
zypperOpenSUSE
macportsmacOS
dnfFedora
snapcraftLinux

If you would like support to be added for a package provider, feel free to contribute the support or request support in the repository issue tracker.

Important note on homebrew and macOS

Some package manager providers can implement a bootstrap method that will automatically configure the package manager on the system if it is not part of the default installation. This is the case with macOS. Comtrya can automatically install homebrew to a macOS system and will do so if a manifest specifies a package.install action and does not overridfe the macOS default of homebrew.

package.install

KeyTypeOptionalDescription
actionstringnopackage.install
namestringnoname of target package
listlistyeslist of multiple packages
providerstringyesSpecify package provider
repositorystringyesspecific repository for a provider and package
fileboolyesSpecify that package is a local package on the file system.
Default value is false

Example

# Install package using default provider
- action: package.install
  name: curl

# Install a list of packages using default provider
- action: package.install
  list:
  - curl
  - wget

# Install a package using a specific package provider
- action: package install
  name: curl
  provider: pkgin

# Install a package specifying a repository
- action: package.install
  name: blox
  provider: homebrew
  repository: cueblox/tap

Local package install support

Some package providers allow for installing a package from the local file system. An example of this would be .pkg files that can be installed using FreeBSD's package manager pkg. As of this time, it requires that the file property be set in the action's definition.

List of supported package providers:

  • pkg (FreeBSD)
  • aptitude (debian/ubuntu)

If you would like to have this feature supported on another package provider, please open an issue at the comtrya GitHub repository.

Example

- action: package.install
  name: /some/path/to/file/nano-8.1.pkg
  file: true