salt.modules.aptly module

Aptly Debian repository manager.

New in version 2018.3.0.

salt.modules.aptly.cleanup_db(config_path='/etc/aptly.conf', dry_run=False)
Remove data regarding unreferenced packages and delete files in the package pool that

are no longer being used by packages.

Parameters

dry_run (bool) -- Report potential changes without making any changes.

Returns

A dictionary of the package keys and files that were removed.

Return type

dict

CLI Example:

salt '*' aptly.cleanup_db
salt.modules.aptly.delete_mirror(name, config_path='/etc/aptly.conf', force=False)

Remove a mirrored remote repository. By default, Package data is not removed.

Parameters
  • name (str) -- The name of the remote repository mirror.

  • config_path (str) -- The path to the configuration file for the aptly instance.

  • force (bool) -- Whether to remove the mirror even if it is used as the source of an existing snapshot.

Returns

A boolean representing whether all changes succeeded.

Return type

bool

CLI Example:

salt '*' aptly.delete_mirror name="test-mirror"
salt.modules.aptly.delete_published(name, config_path='/etc/aptly.conf', endpoint='', prefix=None, skip_cleanup=False, force=False)
Remove files belonging to a published repository. Aptly tries to remove as many files

belonging to this repository as possible.

Parameters
  • name (str) -- The distribution name of the published repository.

  • config_path (str) -- The path to the configuration file for the aptly instance.

  • endpoint (str) -- The publishing endpoint.

  • prefix (str) -- The prefix for publishing.

  • skip_cleanup (bool) -- Whether to remove unreferenced files.

  • force (bool) -- Whether to remove the published repository even if component cleanup fails.

Returns

A boolean representing whether all changes succeeded.

Return type

bool

CLI Example:

salt '*' aptly.delete_published name="test-dist"
salt.modules.aptly.delete_repo(name, config_path='/etc/aptly.conf', force=False)

Remove a local package repository.

Parameters
  • name (str) -- The name of the local repository.

  • config_path (str) -- The path to the configuration file for the aptly instance.

  • force (bool) -- Whether to remove the repository even if it is used as the source of an existing snapshot.

Returns

A boolean representing whether all changes succeeded.

Return type

bool

CLI Example:

salt '*' aptly.delete_repo name="test-repo"
salt.modules.aptly.delete_snapshot(name, config_path='/etc/aptly.conf', force=False)
Remove information about a snapshot. If a snapshot is published, it can not be

dropped without first removing publishing for that snapshot. If a snapshot is used as the source for other snapshots, Aptly will refuse to remove it unless forced.

Parameters
  • name (str) -- The name of the snapshot given during snapshot creation.

  • config_path (str) -- The path to the configuration file for the aptly instance.

  • force (bool) -- Whether to remove the snapshot even if it is used as the source of another snapshot.

Returns

A boolean representing whether all changes succeeded.

Return type

bool

CLI Example:

salt '*' aptly.delete_snapshot name="test-snapshot"
salt.modules.aptly.get_config(config_path='/etc/aptly.conf')

Get the configuration data.

Parameters

config_path (str) -- The path to the configuration file for the aptly instance.

Returns

A dictionary containing the configuration data.

Return type

dict

CLI Example:

salt '*' aptly.get_config
salt.modules.aptly.get_mirror(name, config_path='/etc/aptly.conf', with_packages=False)

Get detailed information about a mirrored remote repository.

Parameters
  • name (str) -- The name of the remote repository mirror.

  • config_path (str) -- The path to the configuration file for the aptly instance.

  • with_packages (bool) -- Return a list of packages in the repo.

Returns

A dictionary containing information about the mirror.

Return type

dict

CLI Example:

salt '*' aptly.get_mirror name="test-mirror"
salt.modules.aptly.get_published(name, config_path='/etc/aptly.conf', endpoint='', prefix=None)

Get the details of a published repository.

Parameters
  • name (str) -- The distribution name of the published repository.

  • config_path (str) -- The path to the configuration file for the aptly instance.

  • endpoint (str) -- The publishing endpoint.

  • prefix (str) -- The prefix for publishing.

Returns

A dictionary containing information about the published repository.

Return type

dict

CLI Example:

salt '*' aptly.get_published name="test-dist"
salt.modules.aptly.get_repo(name, config_path='/etc/aptly.conf', with_packages=False)

Get detailed information about a local package repository.

Parameters
  • name (str) -- The name of the local repository.

  • config_path (str) -- The path to the configuration file for the aptly instance.

  • with_packages (bool) -- Return a list of packages in the repo.

Returns

A dictionary containing information about the repository.

Return type

dict

CLI Example:

salt '*' aptly.get_repo name="test-repo"
salt.modules.aptly.get_snapshot(name, config_path='/etc/aptly.conf', with_packages=False)

Get detailed information about a snapshot.

Parameters
  • name (str) -- The name of the snapshot given during snapshot creation.

  • config_path (str) -- The path to the configuration file for the aptly instance.

  • with_packages (bool) -- Return a list of packages in the snapshot.

Returns

A dictionary containing information about the snapshot.

Return type

dict

CLI Example:

salt '*' aptly.get_snapshot name="test-repo"
salt.modules.aptly.list_mirrors(config_path='/etc/aptly.conf')

Get a list of all the mirrored remote repositories.

Parameters

config_path (str) -- The path to the configuration file for the aptly instance.

Returns

A list of the mirror names.

Return type

list

CLI Example:

salt '*' aptly.list_mirrors
salt.modules.aptly.list_published(config_path='/etc/aptly.conf')

Get a list of all the published repositories.

Parameters

config_path (str) -- The path to the configuration file for the aptly instance.

Returns

A list of the published repositories.

Return type

list

CLI Example:

salt '*' aptly.list_published
salt.modules.aptly.list_repos(config_path='/etc/aptly.conf', with_packages=False)

List all of the local package repositories.

Parameters
  • config_path (str) -- The path to the configuration file for the aptly instance.

  • with_packages (bool) -- Return a list of packages in the repo.

Returns

A dictionary of the repositories.

Return type

dict

CLI Example:

salt '*' aptly.list_repos
salt.modules.aptly.list_snapshots(config_path='/etc/aptly.conf', sort_by_time=False)

Get a list of all the existing snapshots.

Parameters
  • config_path (str) -- The path to the configuration file for the aptly instance.

  • sort_by_time (bool) -- Whether to sort by creation time instead of by name.

Returns

A list of the snapshot names.

Return type

list

CLI Example:

salt '*' aptly.list_snapshots
salt.modules.aptly.new_repo(name, config_path='/etc/aptly.conf', comment=None, component=None, distribution=None, uploaders_file=None, from_snapshot=None, saltenv='base')

Create a new local package repository.

Parameters
  • name (str) -- The name of the local repository.

  • config_path (str) -- The path to the configuration file for the aptly instance.

  • comment (str) -- The description of the repository.

  • component (str) -- The default component to use when publishing.

  • distribution (str) -- The default distribution to use when publishing.

  • uploaders_file (str) -- The repository upload restrictions config.

  • from_snapshot (str) -- The snapshot to initialize the repository contents from.

  • saltenv (str) -- The environment the file resides in.

Returns

A boolean representing whether all changes succeeded.

Return type

bool

CLI Example:

salt '*' aptly.new_repo name="test-repo" comment="Test main repo" component="main" distribution="trusty"
salt.modules.aptly.set_repo(name, config_path='/etc/aptly.conf', comment=None, component=None, distribution=None, uploaders_file=None, saltenv='base')

Configure the settings for a local package repository.

Parameters
  • name (str) -- The name of the local repository.

  • config_path (str) -- The path to the configuration file for the aptly instance.

  • comment (str) -- The description of the repository.

  • component (str) -- The default component to use when publishing.

  • distribution (str) -- The default distribution to use when publishing.

  • uploaders_file (str) -- The repository upload restrictions config.

  • from_snapshot (str) -- The snapshot to initialize the repository contents from.

  • saltenv (str) -- The environment the file resides in.

Returns

A boolean representing whether all changes succeeded.

Return type

bool

CLI Example:

salt '*' aptly.set_repo name="test-repo" comment="Test universe repo" component="universe" distribution="xenial"