Commit Graph

357 Commits (548cacdf6a28a708142c4a2e4ed1ecba8102b60a)

Author SHA1 Message Date
Jonathan Mainguy f662a48de7 Adds the exclude= option to the yum module. Works the same way --exclude does when yum install or yum update 2016-12-08 11:22:57 -05:00
Toshio Kuratomi 9133ae8c55 Allow yum module to take a yaml list of package names and also ", " separated string-list (in addition to comma separated string-list) 2016-12-08 11:22:55 -05:00
James Cammarata 5a0a9d9f72 Add version_added string to new org_id param in rhn_subscription 2016-12-08 11:22:54 -05:00
bugchecker b7b6367ad5 prevent using undefined variable 2016-12-08 11:22:54 -05:00
Brian Coca b6e3ddba9a ifxed error message as code remove the repo r var 2016-12-08 11:22:54 -05:00
David Wittman be0d28a4ac Set disabled repos before enabled repos
The ordering of disabling/enabling yum repositories matters, and
the yum module was mixing and matching the order. Specifically,
when yum-utils isn't installed, the codepath which uses the yum
python module was incorrectly ordering enabling and disabling.

The preferred order is to disable repositories and then enable them
to prevent clobbering. This was previously discussed in
ansible/ansible#5255 and incompletely addressed in 0cca4a3.
2016-12-08 11:22:53 -05:00
Niels de Vos ca9fd7e136 redhat_subscription: add the `org_id` parameter
When subscribing a system with an activationkey, it seems (sometimes?)
required to pass the "--org <number>" parameter to subscription-manager.
Activation Keys can be created through the Red Hat Customer Portal, and
a subscription can be attached to those. This makes is easy to register
systems without passing username/passwords around.

The organisation ID can be retrieved by executing the following command
on a registered system (*not* the account number):

  # subscription-manager identity

URL: https://access.redhat.com/management/activation_keys
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
2016-12-08 11:22:53 -05:00
Michael Scherer 1559bccdb3 Remove unused option in the repoquery call
Citing the man page:
       -q, --query
              For rpmquery compatibility, doesn't do anything.
2016-12-08 11:22:53 -05:00
Ken Dreyer 46372842e8 redhat_subscription: fix activationkeys argument
Prior to this commit, Ansible would pass '--activationkeys <value>' as a
literal string, which the remote server would interpret as a single
argument to subscription-manager.

This led to the following failure message when using an activation key:

  subscription-manager: error: no such option: --activationkey "mykey"

Update the arguments so that the remote server will properly interpret
them as two separate values.
2016-12-08 11:22:53 -05:00
Florian Apolloner f07096bfe5 Added os.path.expanduser when searching for pip executable. 2016-12-08 11:22:51 -05:00
Tim Rupp db6c2bac75 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
2016-12-08 11:22:50 -05:00
Dann Bohn 2cbaf16bcd rhn_channel using depriciated methods. swapped out with their replacements 2016-12-08 11:22:45 -05:00
Brian Coca 4124f8c381 now module fails gracefully instead of stacktrace when trying to install missing deb file 2016-12-08 11:22:44 -05:00
Henry Finucane 464c502f95 dpkg does not take a --force-yes option 2016-12-08 11:22:42 -05:00
giovtorres 1f034a6573 Added pip example installing from local tarball 2016-12-08 11:22:41 -05:00
AlejandroF 2e40773034 Example added
How to define specific version of the package we need...
2016-12-08 11:22:40 -05:00
Conrado Buhrer 09082e6e7f fixed: namespace clash #710 2016-12-08 11:22:40 -05:00
Conrado Buhrer abde33c615 fixed: erroneous logic 2016-12-08 11:22:40 -05:00
Conrado Buhrer a6315043ef fixed: missing check for upgrade flag 2016-12-08 11:22:40 -05:00
Conrado Buhrer 807b168590 fixed: removed build-deb from required_one_of 2016-12-08 11:22:40 -05:00
Conrado Buhrer 3165b39d21 changed: state=build-dep; refactored into install() 2016-12-08 11:22:39 -05:00
Conrado Buhrer 442663a13a added: build-dep to apt module #349
Original code provided by @nathanhruby
2016-12-08 11:22:39 -05:00
Toshio Kuratomi 52bcf4a195 Don't fial if virtualenv is not installed and we do not need to initialize the virtualenv
Fixes #688
2016-12-08 11:22:39 -05:00
Brian Coca 65d3b167e6 now captures cache fetch failures 2016-12-08 11:22:38 -05:00
Michael Scherer b154bf967e Remove unused code
There is no call to yum_base using 'cachedir' argument, so
while it work fine from a cursory look, that's useless code,
and so should be removed to clarify the code.
2016-12-08 11:22:37 -05:00
Michael Scherer 2dfc7122af Use the rpm python module rather than execing rpm
Using the rpm module prevent a uneeded fork, and permit
to skip the signature checking which slow down a bit the
operation, and which would be done by yum on installation
anyway.
2016-12-08 11:22:37 -05:00
Jonathan Mainguy 6be46cb2e3 Fixes --enable-repo for Oracle Linux 2016-12-08 11:22:35 -05:00
fabios 3c53b3b268 mark as upgradable and let apt-get install deal with it 2016-12-08 11:22:35 -05:00
fabios 043242df2c improve fail message and use itertools chain 2016-12-08 11:22:35 -05:00
fabios 21bfa80203 older python-apt compatibility 2016-12-08 11:22:35 -05:00
fabios 301c8b8e09 handle list of list for python-apt < 0.7.9 compatibility 2016-12-08 11:22:35 -05:00
Toshio Kuratomi 1dc2ae0aef Cleanup the old apt compatibility changes 2016-12-08 11:22:35 -05:00
fabios 0ad355585a use low-level apt_pkg.Package 2016-12-08 11:22:35 -05:00
FabioBatSilva a748229f3a fix compatibility issues with python-apt < 0.7.9 2016-12-08 11:22:34 -05:00
Dale Bewley 65d8fbd9ab use state parameter in examples 2016-12-08 11:22:31 -05:00
René Moser ceeeea84cd yum: add update_cache option
Yum does not always update to latest package version unless metadata cache has expired. By runing yum makecache, we ensure the metadata cache has been updated.

Signed-off-by: René Moser <mail@renemoser.net>
2016-12-08 11:22:29 -05:00
Toshio Kuratomi 1af6a85492 Correct variable name 2016-12-08 11:22:27 -05:00
Henry Finucane 2363074dd8 If force=true, ignore python-apt's advice
This lets you downgrade packages, for instance.
2016-12-08 11:22:27 -05:00
Toshio Kuratomi 81978cbacb Fix retrieval of package version in apt module 2016-12-08 11:22:27 -05:00
Toshio Kuratomi 83e43415da Documentation update for apt version wildcards from bryanlarsen 2016-12-08 11:22:27 -05:00
Toshio Kuratomi 615b954cd8 Update package_status and install to account for wildcarded versions. 2016-12-08 11:22:27 -05:00
Toshio Kuratomi 1ca1b80fe8 Decide to allow pkgname and version wildcards so that things like libxml2*=2.9* would work 2016-12-08 11:22:27 -05:00
Toshio Kuratomi 37fa22eb93 Cache pkg name list so we don't recreate the list for every package 2016-12-08 11:22:26 -05:00
Toshio Kuratomi 6b776da7bc Just make things a little more readable 2016-12-08 11:22:26 -05:00
Toshio Kuratomi 945447e392 if __name__ does work with ansible modules 2016-12-08 11:22:26 -05:00
Michael Vogt e360582c4a add apt unittest 2016-12-08 11:22:26 -05:00
Michael Vogt 80d520dde8 Allow foo=1.0* like expressions in apt 2016-12-08 11:22:26 -05:00
Robert Estelle 4e2d05b1f3 Remove incorrect executable permissions. 2016-12-08 11:22:26 -05:00
Brian Coca 5d16410518 corrected comparisson which had accidentally chaned in previous fixes 2016-12-08 11:22:26 -05:00
Brian Coca 9de01b8e10 better handling of deprecated aliases 2016-12-08 11:22:26 -05:00
Brian Coca f91859c817 make sure 'present' is fully equivalente of 'installed' and remove installed from feedback in favoer of 'present' 2016-12-08 11:22:26 -05:00
James Cammarata a32a50568e Use new prompt detection in run_command to detect aptitude prompts
Also adds flags to aptitude command when force=yes is used, in order
to bypass the prompts given for untrusted packages.

Fixes #31
2016-12-08 11:22:25 -05:00
Michael DeHaan 5d814d9fb2 Some more module categorization. 2016-12-08 11:22:25 -05:00
Lorin Hochstein 06218fe7d2 apt_key: add keyserver example to docs 2016-12-08 11:22:23 -05:00
Michael DeHaan ef2a2b9093 package files 2016-12-08 11:22:22 -05:00
Michael DeHaan 213e518165 file extensions! 2016-12-08 11:22:22 -05:00
Michael DeHaan c7eec45b73 Restructuring. 2016-12-08 11:22:22 -05:00