community.general.apt_repo (8.5.0) — module

Manage APT repositories via apt-repo

Authors: Mikhail Gordeev (@obirvalger)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manages APT repositories using apt-repo tool.

See U(https://www.altlinux.org/Apt-repo) for details about apt-repo

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove all repositories
  community.general.apt_repo:
    repo: all
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add repository `Sisysphus` and remove other repositories
  community.general.apt_repo:
    repo: Sisysphus
    state: present
    remove_others: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add local repository `/space/ALT/Sisyphus` and update package cache
  community.general.apt_repo:
    repo: copy:///space/ALT/Sisyphus
    state: present
    update: true

Inputs

    
repo:
    description:
    - Name of the repository to add or remove.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Indicates the desired repository state.
    type: str

update:
    default: false
    description:
    - Update the package database after changing repositories.
    type: bool

remove_others:
    default: false
    description:
    - Remove other then added repositories
    - Used if O(state=present)
    type: bool