Commit graph

63 commits

Author SHA1 Message Date
Matt Martz
d112599fd5 Set version_added to 2.1 for autoremove. Fixes #3200 2016-03-08 07:31:22 -06:00
Matt Davis
7d2fd4e944 Merge pull request #2926 from mattclay/apt-unsafe
Split shell command to avoid use_unsafe_shell.
2016-03-08 04:56:51 +00:00
Brian Coca
38d6c1cd36 expanded info on fail on check + missing apt-python
it now explains that apt module will auto install
2016-02-11 01:22:21 -05:00
Matt Clay
d33e033eba Do not install python-apt in check mode. 2016-02-10 20:39:52 -08:00
Toshio Kuratomi
1df8ebf0c3 use new method of setting locale and other environment variables
The old method left settings in the environment.  The new method takes
care of clearing them after use.  In this module, the old method was
also setting the environment too late to affect all the command line
tools which lead to a bug.

Fixes https://github.com/ansible/ansible/issues/14264
2016-02-07 14:17:36 -08:00
Charles Paul
d7a0a3b7e3 adding autoremove to apt 2016-02-05 12:42:25 -06:00
Matt Clay
e56d668ade Split shell command to avoid use_unsafe_shell.
This mirrors a nearly identical change made to apt_repository.py.

Also removes the use of apt-get --force-yes as it can be dangerous
and should not be necessary (apt_repository.py does not use it).

Repeating the explanation from the apt_respository change below:

Since use_unsafe_shell is suspicious from a security point
of view (or it wouldn't be unsafe), the less we have, the less
code we have to thoroughly inspect for a security audit.

In this case, the '&&' can be replaced by doing 2 calls to run_command.
2016-01-31 02:22:59 -08:00
Arata Notsu
14950824c3 apt: export env vars before run dpkg
Without this change, some trouble may occur when "deb" parameter
is used as env vars controlling dpkg are not set. For example,
installing a package that requires user input will never end since
DEBIAN_FRONTEND=noninteractive is not set.

So export env vars in APT_ENV_VARS before run dpkg, like in cases
using apt-get/aptitude.
2016-01-06 12:11:53 +09:00
Charles Ferguson
fca36415d6 Update the documentation of the 'apt' action for the 'name'.
The package name has two aliases, 'package' and 'pkg'. Add them to the
documentation.
2015-11-24 15:55:31 +00:00
Toshio Kuratomi
5cacef8617 Fixes for bcoca's review of #1916 2015-11-02 13:04:12 -08:00
Harlan Lieberman-Berg
a53cf5434b Give include_recommends a useless default to make the parser happy. 2015-11-02 13:04:12 -08:00
Harlan Lieberman-Berg
06a4efa1cf Add missing brace. 2015-11-02 13:04:12 -08:00
Harlan Lieberman-Berg
a234e9b7b2 Change install_recommended in apt to a trinary.
Conditions are now "yes", "no", and "default", with the latter falling
back to the OS default.
2015-11-02 13:04:12 -08:00
Harlan Lieberman-Berg
baafcfc091 Change behavior of apt.py around installing recommended packages.
Closes #1189.

This will cause the settings in Ansible to override the system settings.
That will have no effect except on systems that have an out-of-Ansible
configuration that disables automatic installation of recommended
packages.  Previously, ansible would use the OS default whenever
install_recommends wasn't part of the playbook.  This change will cause
the Ansible default configuration setting of installing recommended
packages to override the configuration files set on the OS for things
installed through ansible, even when there is no install_recommends
specified in the playbook.  Because the OS default matches the Ansible
default, this shouldn't have wide impact.
2015-11-02 13:04:12 -08:00
Patrick Galbraith
2a93f21821 Fix to issue 12912. Supply 'force' to install of python-apt. 2015-10-26 13:28:10 -04:00
Marius Gedminas
eb17b6a36c apt: check for "0 upgraded" to be at the beginning of the line
Fixes #1678.
2015-08-25 19:15:33 +03:00
Brian Coca
5913f5e5e1 deal with more failures when apt module fails to instantiate pkg
fixes #1499
2015-08-18 14:59:35 -04:00
Brian Coca
93754b903f updated upgrade to a more sensible default as the previous was prone to confusion
fixes #1667
2015-07-03 14:44:17 -04:00
Matt Martz
9eb4219f79 Replaced tabbed indentation with spaces for apt module 2015-07-01 09:39:18 -05:00
Greg DeKoenigsberg
2a5f0bde87 Proper author info for all remaining modules 2015-06-15 15:53:30 -04:00
Brian Coca
6d088169ef Merge pull request #1348 from devjatkin/issue_1230
fix apt to handle virtual packages correctly
2015-05-26 11:55:44 -04:00
Brian Coca
0d41af23c2 Merge pull request #909 from bcoca/apt_return_cacheinfo
added updated cache time to apt, also started documenting return values
2015-05-26 11:54:03 -04:00
Semyon Deviatkin
adf34a6ccd Fix issue #1230
When virtual package providing only one package, look up status of target package
2015-05-18 08:10:22 +00:00
Toshio Kuratomi
7540cbb845 Explain why the apt module does not do implicit regex matches on package name since this is different than the apt-get command line tool.
Fixes #1258
2015-05-07 08:16:46 -07:00
bugchecker
496f9ca180 prevent using undefined variable 2015-04-05 20:40:11 +05:00
Tim Rupp
dba0023940 Add missing import of apt.debfile
In cases when the python-apt package is not installed, ansible will
attempt to install it. After this attempt, it tries to import the
needed apt modules, but forgets to import the apt.debfile module.

The result is that playbooks that use the dpkg argument on a machine
that does not initially have the python-apt package available will
fail with the following error

AttributeError: 'module' object has no attribute 'debfile'

This patch adds the appropriate import to the apt module to ensure
that necessary libraries are available in cases when the dpkg argument
is being used on a system that does not initially have the python-apt
package installed
2015-03-19 14:54:59 -07:00
Brian Coca
19ec770680 added updated cache time to apt, also started documenting return values 2015-03-08 11:47:35 -04:00
Brian Coca
2fcc93e5b3 Merge pull request #785 from bcoca/apt_deb_missing
now module fails gracefully instead of stacktrace
2015-02-25 10:38:29 -05:00
Brian Coca
818767b1d4 Merge pull request #53 from hfinucane/apt-dpkg-force
dpkg does not take a --force-yes option
2015-02-16 18:51:55 -05:00
Brian Coca
611e8b59d6 now module fails gracefully instead of stacktrace when trying to install missing deb file 2015-02-13 11:06:06 -05:00
Conrado Buhrer
bd208da8ea fixed: namespace clash #710 2015-01-27 13:28:56 -02:00
Conrado Buhrer
a5114bfa39 fixed: erroneous logic 2015-01-26 18:16:42 -02:00
Conrado Buhrer
3155656eef fixed: missing check for upgrade flag 2015-01-26 17:48:03 -02:00
Conrado Buhrer
ef3f486f6e fixed: removed build-deb from required_one_of 2015-01-26 17:32:34 -02:00
Conrado Buhrer
711005fe9b changed: state=build-dep; refactored into install() 2015-01-26 15:36:35 -02:00
Conrado Buhrer
d257e2be8c added: build-dep to apt module #349
Original code provided by @nathanhruby
2015-01-26 13:20:00 -02:00
Brian Coca
e2dcb5fc9b now captures cache fetch failures 2015-01-14 17:29:00 -05:00
fabios
9ed842e2d0 mark as upgradable and let apt-get install deal with it 2014-12-28 12:52:57 -05:00
fabios
b747d9411a improve fail message and use itertools chain 2014-12-28 12:52:57 -05:00
fabios
d19f7c7026 older python-apt compatibility 2014-12-28 12:52:57 -05:00
fabios
6fce4a9c3d handle list of list for python-apt < 0.7.9 compatibility 2014-12-28 12:52:57 -05:00
Toshio Kuratomi
170457413d Cleanup the old apt compatibility changes 2014-12-25 00:25:02 -08:00
fabios
a08165ca2e use low-level apt_pkg.Package 2014-12-24 17:55:44 -05:00
FabioBatSilva
55b85ddc46 fix compatibility issues with python-apt < 0.7.9 2014-12-24 10:26:59 -05:00
Toshio Kuratomi
195e7c5a13 Merge commit '383ecdb' into devel 2014-11-18 13:09:29 -08:00
Toshio Kuratomi
383ecdb50b Correct variable name 2014-11-18 13:08:26 -08:00
Henry Finucane
ce02d59651 If force=true, ignore python-apt's advice
This lets you downgrade packages, for instance.
2014-11-14 16:27:20 -08:00
Henry Finucane
4558ed6925 dpkg does not take a --force-yes option 2014-11-14 16:24:08 -08:00
Toshio Kuratomi
fb4854ebcb Fix retrieval of package version in apt module 2014-11-14 10:01:30 -08:00
Toshio Kuratomi
c389cd671f Documentation update for apt version wildcards from bryanlarsen 2014-11-14 09:43:38 -08:00