Commit graph

70 commits

Author SHA1 Message Date
Jean-Frédéric
ea78ad9906 Fix documentation of deb option in apt module
The apt module may install a .deb package on the remote machine, not on the local.
Fix the misleading documentation.
2014-06-06 18:18:44 +02:00
Michael DeHaan
594e5dcdd7 In apt module show 'name' vs pkg to standardize with the rest of the modules. 'pkg' is an alias for name. 2014-04-29 15:48:51 -04:00
James Cammarata
2725538515 Merge pull request #7095 from radeksimko/pokemon-exc-fix
Prevent catching unrelated exceptions
2014-04-21 11:49:04 -05:00
Radek Simko
08befa9c86 Prevention for catching unrelated exceptions added 2014-04-21 15:35:49 +01:00
Radek Simko
7d47f46807 Explicit check of return code for autoinstallation of python-apt added
This will allow easier debugging through more meaningful error message.
2014-04-21 14:10:09 +01:00
Drew Blas
2755a8296e Update apt:deb with correct version
The docs site says this option is available in 1.5, but it is not.  

#5910 https://github.com/ansible/ansible/pull/5910 added the deb option.  The PR was generated two months ago (before 1.5) but was not included until after 1.5 was released.  This fixes the docs.
2014-04-04 05:59:57 -05:00
James Tanner
f7609c8bbe Fix merge conflicts 2014-03-31 13:15:21 -04:00
Michael DeHaan
72696fec03 Merge branch 't-apt-list' of git://github.com/Elemecca/ansible into devel 2014-03-28 12:19:23 -04:00
Colin Mattson
3b710005ad Clarify documentation for apt pkg, state, install_recommends 2014-03-21 13:52:36 -07:00
Jonathan Dray
63e2d9b3f7 fix: bug in apt when python-apt is not present apt-get was not called due to unsafe call 2014-03-17 02:24:12 +01:00
Sam Hanes
3776348acb Add support for YAML lists to apt module. 2014-03-14 00:22:32 -07:00
Patrick Gerken
0c70cc123e Properly catch import errors in apt
When one accidentally tries to run this module as a user, he gets the error message that python-apt must be installed, no matter what. Because importing apt will trigger an exception as a regular user. Explicitly catching the ImportError will let the exception bubble. The exception clearly says Permission denied somewhere, and the user has a better idea, what he must fix.
2014-03-14 02:13:20 +01:00
Michael DeHaan
11146a52f1 Fix other reference to APT_ENV_VARS. 2014-03-11 10:47:53 -04:00
Michael DeHaan
4c7ff55102 Update apt module so that environment variables are set correctly since not going through shell. Very sorry folks, it will be addressed. 2014-03-11 08:39:28 -04:00
James Cammarata
4ab996621d Merge branch '5853-python-2.5-apt_repository-fix' of https://github.com/timurbatyrshin/ansible into timurbatyrshin-5853-python-2.5-apt_repository-fix 2014-02-24 15:20:29 -06:00
Lorin Hochstein
99ff70e15f apt module: Add support for installing .deb packages
Support installing .deb packages from the local filesystem.

    apt: deb=/tmp/mypackage.deb
2014-02-07 20:45:26 -05:00
Timur Batyrshin
2ec777137e further compatibility with older versions of python-apt (#5853) 2014-02-02 23:15:19 +04:00
Rene Moser
3b1c9d6dd6 apt: fixed pkg=<name>=<version> fails if package is not yet installed.
Reported and patch provided by https://github.com/msolo. Closes GH-5625.
2014-01-16 11:05:12 +01:00
lichesser
0f0edf6914 Remove debugging code
I guess this is left over from testing
2014-01-08 02:34:59 +01:00
James Tanner
c74b99ca63 Fixes #5369 Do not pass --force-yes to aptitude 2014-01-07 15:53:28 -05:00
jctanner
f9121ba27c Merge pull request #4872 from timurbatyrshin/4869-old-python-apt-fix
#4869 compatibility with older versions of apt
2013-12-13 10:43:47 -08:00
Rene Moser
0313c517e9 apt: update index before trying to autoinstall python-apt 2013-12-09 10:21:27 +01:00
jctanner
59993ec76a Merge pull request #5181 from mvo5/bugfix/apt-fnmatch-remove
add fnmatch() support for apt remove too (just like install)
2013-12-05 09:18:04 -08:00
Michael Scherer
93105ea590 Fix apt module to be able to install package by giving just a provides and not the full name
The apt module check if a packag eis valid by loking in the cache, checking only for
full name, while it should also check that the name is not just provided.
Fix https://github.com/ansible/ansible/issues/5177
2013-12-05 17:56:54 +01:00
Michael Vogt
824624fd3b add fnmatch() support for apt remove too (just like install) 2013-12-05 17:54:43 +01:00
James Tanner
4f9aadcc07 Addresses #5023 Fix import comments 2013-12-02 15:13:49 -05:00
James Tanner
38edad70ac Fixes #5023 Convert all modules to use new snippet import pattern 2013-12-02 15:11:23 -05:00
Michael DeHaan
4c35b7f380 There's a cleaner way to do this, commit to module formatter pending.
Revert "No longer need to reference 'version_added' in docs for these, as this was quite a while ago."

This reverts commit ff0a41d446.
2013-11-27 21:23:03 -05:00
Michael DeHaan
9e4d71203d No longer need to reference 'version_added' in docs for these, as this was quite a while ago. 2013-11-27 21:19:32 -05:00
James Tanner
db163d51ba Fixes #4891 Catch unicodedecode errors from python-apt 2013-11-13 09:48:56 -05:00
James Tanner
548a48b2f6 Address #4285 remove redundant stderr output in apt module 2013-11-11 22:27:47 -05:00
jctanner
99c0e183ae Merge pull request #4285 from blair/apt-module-register-stdout-stderr
apt: pass child process stdout and stdout to m.fail_json() and m.exit_js...
2013-11-11 19:15:10 -08:00
jctanner
f58bbd5913 Merge pull request #4617 from resmo/feature/python-apt
apt: autoinstall python-apt if apt or apt_pkg is not available
2013-11-11 18:50:43 -08:00
James Tanner
b82f5ef05c Merge pull request #4286 from blair/ansible
apt: do not consider not-removed and not-upgraded packages as changes.
2013-11-11 21:39:07 -05:00
Timur Batyrshin
7e709ce714 #4869 compatibility with older versions of apt 2013-11-11 16:56:05 +04:00
Yegor Minin
0b51476c0a apt: allow specifying dpkg options
This will allow specifying dpkg options as a string passed over to apt
command. dpkg_options expects a comma-separated string of options to be
passed as dpkg options which will be further expanded. For example
dpkg_options='force-confdef,force-confold' will end up as
-o \"Dpkg::Options::=--force-confold\" when passed to apt
Example usage would be:
-m apt -u ubuntu -s \
 -a "upgrade=dist update_cache=yes dpkg_options='force-confold'"
or
apt: upgrade=dist update_cache=yes dpkg_options='force-confold'
2013-11-01 20:11:40 +02:00
Rene Moser
c2c0729f6e apt: autoinstall python-apt if not available 2013-10-21 16:39:18 +02:00
Michael DeHaan
64349632c7 For values that are booleans in the module doc, the value in the doc section should be a boolean or truthiness
is engaged in the documentation formatting.  This fixes the update_cache default in the docs to the proper
value of "no"
2013-10-09 07:52:23 -04:00
Michael DeHaan
85d0ea0d5f Use explicit boolean defaults in apt module to make the code more clear. 2013-10-09 07:47:24 -04:00
Blair Zajac
a5cdf49184 apt: do not consider not-removed and not-upgraded packages as changes.
If one pins a package and does a 'apt-get dist-upgrade' then the
output looks like:

    # apt-get dist-upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    The following packages have been kept back:
      cassandra
    0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

The check for any changes made should only be on the 'upgraded' and
'newly installed' values and not include the 'to remove' and 'not
upgraded' values.
2013-09-28 16:50:50 -07:00
Blair Zajac
4a6c68e98a apt: pass child process stdout and stdout to m.fail_json() and m.exit_json().
Without this, this fails:

    - name: apt-get dist-upgrade
      action: apt upgrade=dist
      register: apt_get_contents

    - name: apt-get clean
      action: command apt-get clean
      when: apt_get_contents.stdout.find("0 upgraded") == -1

TASK: [apt-get clean] *********************************************************

fatal: [192.168.2.2] => error while evaluating conditional: {% if apt_get_contents.stdout.find("0 upgraded") == -1 %} True {% else %} False {% endif %}

FATAL: all hosts have already failed -- aborting
2013-09-28 16:28:18 -07:00
James Cammarata
a6e339fc36 Merge pull request #4138 from resmo/fix/redundant-fail-json
apt: fixed duplicate fail_json
2013-09-17 06:08:51 -07:00
Rene Moser
8c7c0833c2 apt: fixed duplicate fail_json 2013-09-17 15:05:20 +02:00
James Cammarata
c48fc23d75 Use low-level package objects in the apt module to check installed state
Packages which are half-installed are not adequately represented by
the .is_installed field of the apt.package.Package object. By using the
lower-level apt_pkg.Package object (which provides the .current_state
field), we can check for a partially-installed state more accurately.

Fixes #3421
2013-09-11 23:33:59 -05:00
James Cammarata
93a9b1c5c6 Fail apt package install when nothing is matched by the fnmatch pattern
Related to PR #3823
2013-08-12 11:26:31 -05:00
Michael Vogt
2503c36c6a add support for fnmatch() style apt filenames
You can write a apt action like "- apt: pkg=apt*" with this package.
2013-08-12 16:11:15 +02:00
Alan Grosskurth
d91e6e06e4 apt: Run remove commands noninteractively
I'm seeing ansible hang when trying to remove a package, and the hung
process is `whiptail` like in #2763. It looks like we only use
`APT_ENVVARS` and `DPKG_OPTIONS` for the `apt` commands in install()
and upgrade(). This change uses them in remove() as well, which fixes
the hang.
2013-08-05 15:20:45 -07:00
Michael DeHaan
7bfc24706c Fix prev feature commit, Do not require aptitude to use apt commands in the apt module, only needed when upgrading. 2013-07-22 15:15:55 -04:00
Michael DeHaan
6030c1bcaa tweak indentation for 'make pep8' 2013-07-20 12:48:11 -04:00
Michael DeHaan
a58d827d72 Merge pull request #3379 from serenecloud/devel
Return a friendly error message if aptitude isn't installed
2013-07-19 07:36:39 -07:00