parameter |
required |
default |
choices |
comments |
allow_unauthenticated
(added in 2.1) |
no |
no |
|
Ignore if packages cannot be authenticated. This is useful for bootstrapping environments that manage their own apt-key setup.
|
autoclean
(added in 2.4) |
no |
|
|
If yes , cleans the local repository of retrieved package files that can no longer be downloaded.
|
autoremove
(added in 2.1) |
no |
|
|
If yes , remove unused dependency packages for all module states except build-dep. It can also be used as the only option.
Previous to version 2.4, autoclean was also an alias for autoremove, now it is its own separate command. See documentation for further information.
|
cache_valid_time
|
no |
|
|
Update the apt cache if its older than the cache_valid_time. This option is set in seconds. As of Ansible 2.4, this implicitly sets update_cache if set.
|
deb
(added in 1.6) |
no |
|
|
Path to a .deb package on the remote machine.
If :// in the path, ansible will attempt to download deb before installing. (Version added 2.1)
|
default_release
|
no |
|
|
Corresponds to the -t option for apt and sets pin priorities
|
dpkg_options
|
no |
force-confdef,force-confold |
|
Add dpkg options to apt command. Defaults to '-o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"'
Options should be supplied as comma separated list
|
force
|
no |
no |
|
If yes , force installs/removes.
|
force_apt_get
(added in 2.4) |
no |
|
|
Force usage of apt-get instead of aptitude
|
install_recommends
|
no |
|
|
Corresponds to the --no-install-recommends option for apt. yes installs recommended packages. no does not install recommended packages. By default, Ansible will use the same defaults as the operating system. Suggested packages are never installed.
|
name
|
no |
|
|
A package name, like foo , or package specifier with version, like foo=1.0 . Name wildcards (fnmatch) like apt* and version wildcards like foo=1.0* are also supported. Note that the apt-get commandline supports implicit regex matches here but we do not because it can let typos through easier (If you typo foo as fo apt-get would install packages that have "fo" in their name with a warning and a prompt for the user. Since we don't have warnings and prompts before installing we disallow this. Use an explicit fnmatch pattern if you want wildcarding)
aliases: pkg, package
|
only_upgrade
(added in 2.1) |
no |
|
|
Only upgrade a package if it is already installed.
|
purge
|
no |
|
|
Will force purging of configuration files if the module state is set to absent.
|
state
|
no |
present |
- latest
- absent
- present
- build-dep
|
Indicates the desired package state. latest ensures that the latest version is installed. build-dep ensures the package build dependencies are installed.
|
update_cache
|
no |
|
|
Run the equivalent of apt-get update before the operation. Can be run as part of the package installation or as a separate step.
|
upgrade
|
no |
no |
|
If yes or safe, performs an aptitude safe-upgrade.
If full, performs an aptitude full-upgrade.
If dist, performs an apt-get dist-upgrade.
Note: This does not upgrade a specific package, use state=latest for that.
Note: Since 2.4, apt-get is used as a fall-back if aptitude is not present.
|