transactions.package.apt

Provides apt related transactions.

Functions

simple_automation.transactions.package.apt.is_installed(context: simple_automation.context.Context, name: str)

Queries whether or not the given package name is installed on the remote.

Parameters
  • context (Context) – The context providing the execution context and templating dictionary.

  • name (str) – The package name to query. Will be templated.

Returns

True if the package is installed

Return type

bool

simple_automation.transactions.package.apt.package(context: simple_automation.context.Context, name: str, state='present', opts: Optional[list] = None)

Installs or uninstalls the given package name (depending on state == “present” or “absent”). Additional options to apt-get can be passed via opts, and will be appended before the package name. opts will be templated.

Parameters
  • context (Context) – The context providing the execution context and templating dictionary.

  • name (str) – The package name to be installed or uninstalled. Will be templated.

  • state (str, optional) – The desired state, either “present” or “absent”. Defaults to “present”.

  • opts (list[str]) – Additional options to pacman. Will be templated.

Returns

The completed transaction

Return type

CompletedTransaction