apt_repo – Manage APT repositories via apt-repo — Ansible Documentation

- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# apt_repo – Manage APT repositories via apt-repo

New in version 2.8.

- Synopsis
- Parameters
- Notes
- Examples
- Status

## Synopsis

- Manages APT repositories using apt-repo tool.
- See https://www.altlinux.org/Apt-repo for details about apt-repo

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
remove_others boolean | Choices: no ← yes | Remove other then added repositories Used if state=present
repo - / required |  | Name of the repository to add or remove.
state - | Choices: absent present ← | Indicates the desired repository state.
update boolean | Choices: no ← yes | Update the package database after changing repositories.

## Notes

Note

- This module works on ALT based distros.
- Does NOT support checkmode, due to a limitation in apt-repo tool.

## Examples

    - name: Remove all repositories
      apt_repo:
        repo: all
        state: absent

    - name: Add repository `Sisysphus` and remove other repositories
      apt_repo:
        repo: Sisysphus
        state: present
        remove_others: yes

    - name: Add local repository `/space/ALT/Sisyphus` and update package cache
      apt_repo:
        repo: copy:///space/ALT/Sisyphus
        state: present
        update: yes

## Status

- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]

### Authors

- Mikhail Gordeev (@obirvalger)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.