|
|
|
@ -63,21 +63,20 @@ options:
|
|
|
|
|
default: 'no'
|
|
|
|
|
default_release:
|
|
|
|
|
description:
|
|
|
|
|
- Corresponds to the C(-t) option for I(apt) and sets pin priorities
|
|
|
|
|
- Corresponds to the C(-t) option for I(apt) and sets pin priorities.
|
|
|
|
|
aliases: [ default-release ]
|
|
|
|
|
type: str
|
|
|
|
|
install_recommends:
|
|
|
|
|
description:
|
|
|
|
|
- Corresponds to the C(--no-install-recommends) option for I(apt). V(true) installs recommended packages. V(false) does not install
|
|
|
|
|
- Corresponds to the C(--no-install-recommends) option for C(apt). V(true) installs recommended packages. V(false) does not install
|
|
|
|
|
recommended packages. By default, Ansible will use the same defaults as the operating system. Suggested packages are never installed.
|
|
|
|
|
aliases: [ install-recommends ]
|
|
|
|
|
type: bool
|
|
|
|
|
force:
|
|
|
|
|
description:
|
|
|
|
|
- 'Corresponds to the C(--force-yes) to I(apt-get) and implies O(allow_unauthenticated=yes) and O(allow_downgrade=yes)'
|
|
|
|
|
- "This option will disable checking both the packages' signatures and the certificates of the
|
|
|
|
|
web servers they are downloaded from."
|
|
|
|
|
- 'This option *is not* the equivalent of passing the C(-f) flag to I(apt-get) on the command line'
|
|
|
|
|
- 'Corresponds to the C(--force-yes) to C(apt-get) and implies O(allow_unauthenticated=yes) and O(allow_downgrade=yes).'
|
|
|
|
|
- "This option will disable checking both the packages' signatures and the certificates of the web servers they are downloaded from."
|
|
|
|
|
- 'This option *is not* the equivalent of passing the C(-f) flag to C(apt-get) on the command line.'
|
|
|
|
|
- '**This is a destructive operation with the potential to destroy your system, and it should almost never be used.**
|
|
|
|
|
Please also see C(man apt-get) for more information.'
|
|
|
|
|
type: bool
|
|
|
|
@ -85,7 +84,7 @@ options:
|
|
|
|
|
clean:
|
|
|
|
|
description:
|
|
|
|
|
- Run the equivalent of C(apt-get clean) to clear out the local repository of retrieved package files. It removes everything but
|
|
|
|
|
the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
|
|
|
|
|
the lock file from C(/var/cache/apt/archives/) and C(/var/cache/apt/archives/partial/).
|
|
|
|
|
- Can be run as part of the package installation (clean runs before install) or as a separate step.
|
|
|
|
|
type: bool
|
|
|
|
|
default: 'no'
|
|
|
|
@ -93,7 +92,7 @@ options:
|
|
|
|
|
allow_unauthenticated:
|
|
|
|
|
description:
|
|
|
|
|
- Ignore if packages cannot be authenticated. This is useful for bootstrapping environments that manage their own apt-key setup.
|
|
|
|
|
- 'O(allow_unauthenticated) is only supported with O(state): V(install)/V(present)'
|
|
|
|
|
- 'O(allow_unauthenticated) is only supported with O(state): V(install)/V(present).'
|
|
|
|
|
aliases: [ allow-unauthenticated ]
|
|
|
|
|
type: bool
|
|
|
|
|
default: 'no'
|
|
|
|
@ -111,7 +110,7 @@ options:
|
|
|
|
|
version_added: "2.12"
|
|
|
|
|
allow_change_held_packages:
|
|
|
|
|
description:
|
|
|
|
|
- Allows changing the version of a package which is on the apt hold list
|
|
|
|
|
- Allows changing the version of a package which is on the apt hold list.
|
|
|
|
|
type: bool
|
|
|
|
|
default: 'no'
|
|
|
|
|
version_added: '2.13'
|
|
|
|
@ -128,14 +127,14 @@ options:
|
|
|
|
|
type: str
|
|
|
|
|
dpkg_options:
|
|
|
|
|
description:
|
|
|
|
|
- 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
|
|
|
|
|
- Add C(dpkg) options to C(apt) command. Defaults to C(-o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold").
|
|
|
|
|
- Options should be supplied as comma separated list.
|
|
|
|
|
default: force-confdef,force-confold
|
|
|
|
|
type: str
|
|
|
|
|
deb:
|
|
|
|
|
description:
|
|
|
|
|
- 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)
|
|
|
|
|
- If C(://) in the path, ansible will attempt to download deb before installing. (Version added 2.1)
|
|
|
|
|
- Requires the C(xz-utils) package to extract the control file of the deb package to install.
|
|
|
|
|
type: path
|
|
|
|
|
required: false
|
|
|
|
@ -143,7 +142,8 @@ options:
|
|
|
|
|
autoremove:
|
|
|
|
|
description:
|
|
|
|
|
- If V(true), remove unused dependency packages for all module states except V(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.
|
|
|
|
|
- Previous to version 2.4, O(autoclean) was also an alias for O(autoremove), now it is its own separate command.
|
|
|
|
|
See documentation for further information.
|
|
|
|
|
type: bool
|
|
|
|
|
default: 'no'
|
|
|
|
|
version_added: "2.1"
|
|
|
|
@ -155,10 +155,10 @@ options:
|
|
|
|
|
version_added: "2.4"
|
|
|
|
|
policy_rc_d:
|
|
|
|
|
description:
|
|
|
|
|
- Force the exit code of /usr/sbin/policy-rc.d.
|
|
|
|
|
- For example, if I(policy_rc_d=101) the installed package will not trigger a service start.
|
|
|
|
|
- If /usr/sbin/policy-rc.d already exists, it is backed up and restored after the package installation.
|
|
|
|
|
- If V(null), the /usr/sbin/policy-rc.d isn't created/changed.
|
|
|
|
|
- Force the exit code of C(/usr/sbin/policy-rc.d).
|
|
|
|
|
- For example, if O(policy_rc_d=101) the installed package will not trigger a service start.
|
|
|
|
|
- If C(/usr/sbin/policy-rc.d) already exists, it is backed up and restored after the package installation.
|
|
|
|
|
- If V(null), the C(/usr/sbin/policy-rc.d) is not created/changed.
|
|
|
|
|
type: int
|
|
|
|
|
default: null
|
|
|
|
|
version_added: "2.8"
|
|
|
|
@ -179,7 +179,7 @@ options:
|
|
|
|
|
version_added: "2.11"
|
|
|
|
|
force_apt_get:
|
|
|
|
|
description:
|
|
|
|
|
- Force usage of apt-get instead of aptitude
|
|
|
|
|
- Force usage of apt-get instead of aptitude.
|
|
|
|
|
type: bool
|
|
|
|
|
default: 'no'
|
|
|
|
|
version_added: "2.4"
|
|
|
|
@ -205,22 +205,22 @@ attributes:
|
|
|
|
|
platforms: debian
|
|
|
|
|
notes:
|
|
|
|
|
- Three of the upgrade modes (V(full), V(safe) and its alias V(true)) required C(aptitude) up to 2.3, since 2.4 C(apt-get) is used as a fall-back.
|
|
|
|
|
- In most cases, packages installed with apt will start newly installed services by default. Most distributions have mechanisms to avoid this.
|
|
|
|
|
- In most cases, packages installed with I(apt) will start newly installed services by default. Most distributions have mechanisms to avoid this.
|
|
|
|
|
For example when installing Postgresql-9.5 in Debian 9, creating an executable shell script (/usr/sbin/policy-rc.d) that throws
|
|
|
|
|
a return code of 101 will stop Postgresql 9.5 starting up after install. Remove the file or its execute permission afterward.
|
|
|
|
|
- The apt-get commandline supports implicit regex matches here but we do not because it can let typos through easier
|
|
|
|
|
a return code of 101 will stop Postgresql 9.5 starting up after install. Remove the file or its execute permission afterward.
|
|
|
|
|
- The C(apt-get) commandline supports implicit regex matches here but we do not because it can let typos through easier
|
|
|
|
|
(If you typo C(foo) as C(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)
|
|
|
|
|
Since there are no warnings and prompts before installing, we disallow this. Use an explicit fnmatch pattern if you want wildcarding).
|
|
|
|
|
- When used with a C(loop:) each package will be processed individually, it is much more efficient to pass the list directly to the O(name) option.
|
|
|
|
|
- When O(default_release) is used, an implicit priority of 990 is used. This is the same behavior as C(apt-get -t).
|
|
|
|
|
- When an exact version is specified, an implicit priority of 1001 is used.
|
|
|
|
|
- If the interpreter can't import ``python-apt``/``python3-apt`` the module will check for it in system-owned interpreters as well.
|
|
|
|
|
- If the interpreter can't import C(python-apt)/C(python3-apt) the module will check for it in system-owned interpreters as well.
|
|
|
|
|
If the dependency can't be found, the module will attempt to install it.
|
|
|
|
|
If the dependency is found or installed, the module will be respawned under the correct interpreter.
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
EXAMPLES = '''
|
|
|
|
|
- name: Install apache httpd (state=present is optional)
|
|
|
|
|
- name: Install apache httpd (state=present is optional)
|
|
|
|
|
ansible.builtin.apt:
|
|
|
|
|
name: apache2
|
|
|
|
|
state: present
|
|
|
|
|