ansible.builtin.deb822_repository module – Add and remove deb822 formatted repositories
Note
This module is part of ansible-core and included in all Ansible installations. In most cases, you can use the short module name deb822_repository even without specifying the collections keyword. However, we recommend you use the Fully Qualified Collection Name (FQCN) ansible.builtin.deb822_repository for easy linking to the module documentation and to avoid conflicting with other collections that may have the same module name.
New in ansible-core 2.15
Synopsis
- Add and remove deb822 formatted repositories in Debian based distributions.
Requirements
The below requirements are needed on the host that executes this module.
- python3-debian / python-debian
Parameters
Parameter | Comments |
|---|---|
allow_downgrade_to_insecure boolean | Allow downgrading a package that was previously authenticated but is no longer authenticated. Choices:
|
allow_insecure boolean | Allow insecure repositories. Choices:
|
allow_weak boolean | Allow repositories signed with a key using a weak digest algorithm. Choices:
|
architectures list / elements=string | Architectures to search within repository. |
by_hash boolean | Controls if APT should try to acquire indexes via a URI constructed from a hashsum of the expected file instead of using the well-known stable filename of the index. Choices:
|
check_date boolean | Controls if APT should consider the machine’s time correct and hence perform time related checks, such as verifying that a Release file is not from the future. Choices:
|
check_valid_until boolean | Controls if APT should try to detect replay attacks. Choices:
|
components list / elements=string | Components specify different sections of one distribution version present in a |
date_max_future integer | Controls how far from the future a repository may be. |
enabled boolean | Tells APT whether the source is enabled or not. Choices:
|
inrelease_path string | Determines the path to the |
languages list / elements=string | Defines which languages information such as translated package descriptions should be downloaded. |
mode any | The octal mode for newly created files in Default: |
name string / required | Name of the repo. Specifically used for |
pdiffs boolean | Controls if APT should try to use Choices:
|
signed_by string | Either a URL to a GPG key, absolute path to a keyring file, one or more fingerprints of keys either in the |
state string | A source string state. Choices:
|
suites list / elements=string | Suite can specify an exact path in relation to the URI(s) provided, in which case the Components: must be omitted and suite must end with a slash ( |
targets list / elements=string | Defines which download targets apt will try to acquire from this source. |
trusted boolean | Decides if a source is considered trusted or if warnings should be raised before, for example packages are installed from this source. Choices:
|
types list / elements=string | Which types of packages to look for from a given source; either binary Choices:
Default: |
uris list / elements=string | The URIs must specify the base of the Debian distribution archive, from which APT finds the information it needs. |
Notes
Note
- This module will not automatically update caches, call the ansible.builtin.apt module based on the changed state.
Examples
- name: Add debian repo
deb822_repository:
name: debian
types: deb
uris: http://deb.debian.org/debian
suites: stretch
components:
- main
- contrib
- non-free
- name: Add debian repo with key
deb822_repository:
name: debian
types: deb
uris: https://deb.debian.org
suites: stable
components:
- main
- contrib
- non-free
signed_by: |-
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEYCQjIxYJKwYBBAHaRw8BAQdAD/P5Nvvnvk66SxBBHDbhRml9ORg1WV5CvzKY
CuMfoIS0BmFiY2RlZoiQBBMWCgA4FiEErCIG1VhKWMWo2yfAREZd5NfO31cFAmAk
IyMCGyMFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AACgkQREZd5NfO31fbOwD6ArzS
dM0Dkd5h2Ujy1b6KcAaVW9FOa5UNfJ9FFBtjLQEBAJ7UyWD3dZzhvlaAwunsk7DG
3bHcln8DMpIJVXht78sL
=IE0r
-----END PGP PUBLIC KEY BLOCK-----
- name: Add repo using key from URL
deb822_repository:
name: example
types: deb
uris: https://download.example.com/linux/ubuntu
suites: '{{ ansible_distribution_release }}'
components: stable
architectures: amd64
signed_by: https://download.example.com/linux/ubuntu/gpg
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
dest string | Path to the repository file Returned: always Sample: |
key_filename string | Path to the signed_by key file Returned: always Sample: |
repo string | A source string for the repository Returned: always Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/deb822_repository_module.html