apt
Collection: builtin
Full Name: parallax.builtin.apt
Aliases: ansible.builtin.apt, apt
Synopsis
Manage apt
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| name | list | Package name, or package specifier with version (aliases: pkg, package) | ||
| state | string | present | Desired state of the package Choices: absent, build-dep, fixed, latest, present | |
| update_cache | bool | false | Run apt-get update before the operation (alias: update-cache) | |
| update_cache_retries | int | 5 | Number of retries if update_cache fails | |
| update_cache_retry_max_delay | int | 12 | Max delay between retries in seconds | |
| cache_valid_time | int | 0 | Update cache if older than this many seconds | |
| allow_downgrade | bool | false | Allow downgrades of packages (aliases: allow-downgrade, allow_downgrades) | |
| allow_unauthenticated | bool | false | Ignore if packages cannot be authenticated (alias: allow-unauthenticated) | |
| allow_change_held_packages | bool | false | Allow apt to upgrade held packages (aliases: allow-change-held-packages, force) | |
| deb | string | Path to a .deb package on the remote machine | ||
| default_release | string | Default release to install packages from (alias: default-release) | ||
| dpkg_options | string | force-confdef,force-confold | Add dpkg options to apt command | |
| autoremove | bool | false | Remove unused dependency packages | |
| autoclean | bool | false | Cleans the local repository of packages | |
| clean | bool | false | Run apt-get clean | |
| install_recommends | bool | true | Install recommended packages (alias: install-recommends) | |
| force | bool | false | Force usage of apt instead of apt-get | |
| force_apt_get | bool | false | Force usage of apt-get instead of apt | |
| upgrade | string | no | Upgrade all packages to latest version Choices: no, yes, safe, full, dist | |
| only_upgrade | bool | false | Only upgrade a package if installed | |
| purge | bool | false | Purge package configuration files | |
| fail_on_autoremove | bool | false | Fail if packages would be autoremoved | |
| lock_timeout | int | 60 | How long to wait for lock (seconds) | |
| policy_rc_d | int | 0 | Force policy-rc.d return code | |
| pkg | list | Alias for name parameter | ||
| package | list | Alias for name parameter | ||
| update-cache | bool | Alias for update_cache parameter | ||
| allow-downgrade | bool | Alias for allow_downgrade parameter | ||
| allow_downgrades | bool | Alias for allow_downgrade parameter | ||
| allow-downgrades | bool | Alias for allow_downgrade parameter | ||
| allow-unauthenticated | bool | Alias for allow_unauthenticated parameter | ||
| allow-change-held-packages | bool | Alias for allow_change_held_packages parameter | ||
| default-release | string | Alias for default_release parameter | ||
| install-recommends | bool | Alias for install_recommends parameter |
Example
- name: Example apt task
apt:
name: <your_name>
state: absent