Commit Graph

826 Commits (f5658f4e5048ae6f2cf1d8eb434be3602fc6bb3a)

Author SHA1 Message Date
Toshio Kuratomi 2a9ddb1c70 Clarify the comment 9 years ago
Toshio Kuratomi d3543ff67c Older versions of rhn-client-tools don't understand containment tests. 9 years ago
Dag Wieers f08ba8c7d6 Performance improvement using in-operator on dicts
Just a small cleanup for the existing occurrences.

Using the in-operator for hash lookups is faster than using .keys()
http://stackoverflow.com/questions/29314269/why-do-key-in-dict-and-key-in-dict-keys-have-the-same-output
9 years ago
Dag Wieers c411d518b9 Performance improvement using in-operator for hash lookups
Just a small cleanup for the existing occurrences.

Using the in-operator for hash lookups is faster than using .has_key()
http://stackoverflow.com/questions/1323410/has-key-or-in
9 years ago
Sam Doran 8fdf02d468 Change example syntax on pip module 9 years ago
Sam Doran 58eb966613 Change example syntax on gem module 9 years ago
Sam Doran 94392dd87a Change example syntax on easy_install module 9 years ago
Sam Doran 7363fd198b Change example syntax on yum module 9 years ago
Sam Doran 68c78cf40d Change example syntax on rpm_key module 9 years ago
Sam Doran f6025edad2 Change example syntax on rhn_register module 9 years ago
Sam Doran db5076cd8a Change example syntax on rhn_subscription module 9 years ago
Sam Doran 8533529c2b Change example syntax on redhat_subscription module 9 years ago
Sam Doran 34fb8c3ec2 Change example syntax on package module 9 years ago
Sam Doran 3f224de12a Change example syntax on apt_rpm module 9 years ago
Sam Doran aa18bf8933 Change example syntax on apt_repository module 9 years ago
Sam Doran 5995bf27ba Change example syntax on apt_key module 9 years ago
Sam Doran 21f6aa076c Change example syntax on apt module 9 years ago
jctanner 80b69c4821 Correct the handling of state=latest for yum groups. (#4141)
* Correct the handling up state=latest for yum groups.
* Use yum-deprecated when available

Fixes #4119
9 years ago
René Moser be0e6faa7b apt: fix changed when cache updated but not pkg (#5487) 9 years ago
Matt Martz 931a713350 If fetch_url failed to download the URL fail early with a proper error message. Fixes #5474 (#5476) 9 years ago
scottb 4263ef259e Merge pull request #5461 from Cbeck527/devel
Add more specific language to apt_key description
9 years ago
Matt Robinson 69e3aa12de apt_repository: Relax PPA checks and add basename (#5432)
Allow installation of PPA repositories on non-Ubuntu Debian derived
distribution targets (e.g. neon, Mint, Debian itself) by removing the
specific check for UbuntuDistribution before allowing PPA: format
sources. This fixes the addition of PPA repositories under KDE neon (as
the codenames match the base Ubuntu distribution).

To make the functionality also useful under Mint and Debian which have
different codenames to their Ubuntu upstream / downstream releases, add
a 'codename' option to override the default used in the PPA source
entry.
9 years ago
Chris Becker 258dd810e9 Add more specific language to module description and examples
* Add 'on the remote server' to `file` parameter description
* Add example showing how to use the `file` parameter, with specific
  language about the file's location being on the 'remote server'
9 years ago
jctanner 5890fba5dc apt: update cache until corrupt package lists are fixed (#5448)
* apt: If the cache object fails to lost due to a corrupt file, try to update the cache until it is fixed.
* Append -q to the update parameters
* Remove unused variable
* Use a string that doesn't rely on internationalization
* Use py24 exception style
* Use get_exception

Fixes #2951
9 years ago
Toshio Kuratomi d2106f1c92 Need to locate a pip inside a venv when venv is specified
Alternative to #5359

Fixes #5347
9 years ago
Evgenii Terechkov b16e2597a4 Replace dangerous shell calls with module.run_command 9 years ago
Evgenii Terechkov bfee04d503 Ensure that we use shell
to run apt-get -y install ... >/dev/null

this commit must fix #2839
9 years ago
Toshio Kuratomi 1182d1f0b7 Order of return values was reversed 9 years ago
Toshio Kuratomi ac314a5e3d Fix builddep when a source package exists without a binary package
builddep only requires a source package to be in the repos but our code
was checking for a binary package before running buiddep.  Reversing the
order makes it work correctly.

Fixes #4519
9 years ago
Toshio Kuratomi 66d47c8149 Only change to short IDs for delete (#5353)
* Only change to short IDs for delete

If the user specifies long IDs, use them for all commands except for
deleting a key.  Need to use short IDs there because of an upstream
apt_key bug.  Fixed in apt_key 1.10 (fix is present in Ubuntu 16.04 but
not Ubuntu 14.0 or some Debians).

Fixes #5237

* Check that apt-key really erased the key

When erasing a key, apt-key does not understand how to process subkeys.
This update explicitly checks that the key_id is no longer present and
throws an error if it is.  It also hints at subkeys being a possible
problem in the error message and the documentation.

Fixes #5119

* Fix apt_key check mode with long ids

apt-key can be given a key id longer than 16 chars to more accurately
define what key to download.  However, we can use a maximum of 16
chars to verify whether a key is installed or not.  So we need to use
different lengths for the id depending on what we're doing with it.

Fixes #2622

Also:

* Some style cleanups
* Use get_bin_path to find the path to apt-key and then use that when
  invoking apt-key
* Return a nice user error message if the key was not found on the
  keyserver
* Make file and keyring parameters type='path' so envars and tilde are
  expanded
9 years ago
Toshio Kuratomi 653ec28a97 On Ubuntu16, virtualenv always tries to use python2 even when python2 is not installed.
Workaround that by mimicing the upstream virtualenv behaviour in code
(use the python version that was used to invoke virtualenv/the ansible
module)
9 years ago
Filip Hubík 2d459b797f Fix incorrect line wrapping in output from yum check-updates
https://github.com/ansible/ansible-modules-core/issues/4318#issuecomment-251416661
9 years ago
Dag Wieers 20726b94be Ensure yum failures in with-loop result into a failed task
The implementation is fairly simple, we force the rc= parameter to not be zero so that the check in _executor/task_result.py_ correctly determines that it failed. Without this change Ansible would report the task to be ok (despite failed=True and msg=Some_error_message) although Ansible stops and the summary output reports a failed task.

This fixes #4214, #4384 and also relates to ansible/ansible#12070, ansible/ansible#16006, ansible/ansible##16597, ansible/ansible#17208 and ansible/ansible#17252
9 years ago
Michael Scherer 6f15dfd464 Make pip module use pip3 on python 3 9 years ago
Alfredo Solano 845cc1a531 apt: doc: use yaml syntax in examples (#5070) 9 years ago
John R Barker 312f578f93 Bulk spelling improvement to modules-core (#5225)
* Correct spelling mistakes

* Correct more spelling issues

* merge conflict

* Revert typo in parms
9 years ago
John Barker 275fa3f055 Correct functional typos 9 years ago
Kevin Carter 9b2ee881d9 apt: fix cache time handling (#1517)
This change is in response to issue #1497 where the apt module would not properly updating the apt cache in some situations and never returned a state change on cache update when the module was used without or without an item to be installed or upgraded.

The change simply allows the apt module to update the cache when update_cache option is used without or without a set cache_valid_time. 
If cache_valid_time is set and the on disk mtime for apt cache is ">" the provided amount of seconds, which now has a default of 0, the apt cache will be updated. Additionally if no upgrade, package, or deb is installed or changed but the apt cache is updated the module will return a changed state which will help users to know that the state of the environment has changed due to a task operation, even if it was only an apt cache update.

fixes #1497

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
9 years ago
Toshio Kuratomi b4f1d0d0c2 Fix pip freeze workaround with virtualenv (#4951) 9 years ago
Toshio Kuratomi 5b1994cb42 pip list isn't available on pip less than 1.3 so make a fallback (#4947) 9 years ago
Toshio Kuratomi 70d4ff8e38 Fix parsing of pip output 9 years ago
Rob Cutmore 12a7027c49 Pip: use 'pip list' when available for package list (#4644)
* Pip: handle parsing different pip commands

* Pip: use 'pip list' when available

* Pip: explicitly check which command is used

* Pip: add error checking when fetching packages
9 years ago
Will Thames a076309a0f Check whether yum file or URL install is an upgrade (#4547)
Rather than just checking whether a package with the right
name is installed, use `local_nvra` to check whether the
version/release/arch differs too.

Remove `local_name` as it is a shortcut too far.

Fixes #3807
Fixes #4529
9 years ago
Matt Clay 683e5e4d1a Fix python 3 issues with apt* modules. (#4848)
- Use range instead of xrange.
- Use python3-apt package for python 3.
- Eliminate unsupported for/else/raise usage.
- Use list on dict.items when modifying dict.
- Update requirements documentation.

Also made non-intrustive style fixes (adding blank lines).
9 years ago
Matt Clay bf5b3de83e Python 3 fixes for apt_* modules. (#4754) 9 years ago
Toshio Kuratomi 958d894c61 We've decided that pythn 3.5 is the minimum python3 version (#4572) 10 years ago
Guillaume Delpierre 2a25e27979 gem: add support for --env-shebang (#4377)
* gem: add support for --env-shebang

* fix version added
10 years ago
Alexey Sheplyakov 5f1ac88414 apt_key: fix spurious failure to import a subkey (#4366)
Importing a (sign only) subkey with apt_key module always fails,
however the actual keyring gets created and contains the correct keys.
Apparently the all_keys function skips the subkeys, hence the problem.

Fixes #4365
10 years ago
Evan b5ad8b83be pip: Fix uninitialized variable during check_mode (#4379)
During check_mode (`--check`), the variable change could be
used uninitialized, yielding this error:

`UnboundLocalError: local variable 'changed' referenced before assignment`

This changeset simply initializes it to False.
10 years ago
Jan Hutař 8e241a87cc Add way to specify environment (#3453) 10 years ago