apt_repository

Collection: builtin

Full Name: parallax.builtin.apt_repository

Aliases: ansible.builtin.apt_repository, apt_repository

Synopsis

Add or remove an apt repository definition

Parameters

NameTypeRequiredDefaultDescription
repostringyesA source string for the repository
statestringpresentA source string state Choices: absent, present
modestring0644The octal mode for newly created files
update_cachebooltrueRun the equivalent of apt-get update after adding the repository
update_cache_retriesint5Number of retries for apt-get update
update_cache_retry_max_delayint12Maximum delay between retries in seconds
filenamestringSets the name of the source list file in sources.list.d
codenamestringOverride the distribution codename to use for PPA repositories

Example

- name: Enable the Docker apt repository
  apt_repository:
    repo: deb https://download.docker.com/linux/ubuntu jammy stable
    state: present
    update_cache: true