ansible/packaging
Hector Acosta b5fe46d48c Correctly handle .repo files in zypper_repository module
Before the changes, removing a repository required a repo url. This shouldn't be required since zypper allows removing a repo based on its alias (mapped to name in this module).

The name variable was always required, which is misleading since repofiles provide their own alias. So a runtime check was added to avoid this confusion.

Additionaly, running this module on .repo files weren't idempotent. e.g

Before:
$ ./hacking/test-module -m library/packaging/zypper_repository -a "repo=http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo name=foo"
{"repo": "http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo", "state": "present", "changed": true}
$ ./hacking/test-module -m library/packaging/zypper_repository -a "repo=http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo name=foo"
{"msg": "Repository named 'devel_languages_python' already exists. Please use another alias.\n", "failed": true}

After:
$ ./hacking/test-module -m library/packaging/zypper_repository -a "repo=http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo"
{"repo": "http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo", "state": "present", "changed": true}
$ ./hacking/test-module -m library/packaging/zypper_repository -a "repo=http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo"
{"repo": "http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo", "state": "present", "changed": false}

Signed-off-by: Hector Acosta <hector.acosta@gmail.com>
2014-06-26 13:17:27 -07:00
..
apt Restore #6484 reverted by c751168. 2014-06-23 17:12:19 -07:00
apt_key apt_key clear message when downloading key returns an (http) error code 2014-06-25 15:30:34 +02:00
apt_repository Default use_proxy to True for fetch_url() 2014-05-19 23:04:13 -05:00
apt_rpm add simplejson as alternative to json 2014-04-25 02:44:51 -07:00
composer Update composer example 2014-05-16 14:06:55 +01:00
cpanm Update cpanm 2014-03-20 08:10:02 -04:00
easy_install Force command action to not be executed by the shell unless specifically enabled 2014-03-10 16:13:30 -05:00
gem Allow gem executable to contain spaces 2014-06-17 11:58:10 +02:00
homebrew Add upgrade_all option to homebrew module. 2014-05-23 11:09:18 -04:00
homebrew_cask Update cask version, changelog. 2014-03-16 16:18:27 -04:00
homebrew_tap Update tap version, changelog 2014-03-16 16:17:11 -04:00
layman Changelog and version updates. 2014-03-28 17:01:15 -04:00
macports Various commits to enable no-shell or safe-shell usage, more to come. 2014-03-12 16:44:35 -04:00
npm Allow executable to contain spaces 2014-06-17 01:31:24 +02:00
openbsd_pkg Minor cleanup of openbsd_pkg example comment 2014-06-16 11:35:57 -05:00
opkg Various commits to enable no-shell or safe-shell usage, more to come. 2014-03-12 16:44:35 -04:00
pacman Resolve merge. 2014-03-28 14:56:59 -04:00
pip Force command action to not be executed by the shell unless specifically enabled 2014-03-10 16:13:30 -05:00
pkgin Fixes for run_command shell usage in remainder of packaging modules, save portinstall. 2014-03-12 16:57:18 -04:00
pkgng Fixed test on 'cached' parameter. 2014-04-15 16:41:27 +02:00
pkgutil Fix in pkgutil: don't call pipes.quote() on None. 2014-06-15 10:20:35 +08:00
portage Successfull exit if sync=yes and no package provided 2014-06-26 15:02:15 +03:00
portinstall Fixed FreeBSD ports install issue 2014-06-26 20:52:57 +05:30
redhat_subscription Replace CommandException with Exception 2014-05-23 12:44:01 -07:00
rhn_channel Add missing license headers to two modules and standardize formatting of another. 2014-04-24 10:32:54 -04:00
rhn_register Fix typo in variable name 2014-05-23 16:09:57 -07:00
rpm_key Add missing license headers to two modules and standardize formatting of another. 2014-04-24 10:32:54 -04:00
svr4pkg Cleaning up svr4pkg commit fix for #7645 2014-06-09 10:48:06 -05:00
swdepot Fixes for run_command shell usage in remainder of packaging modules, save portinstall. 2014-03-12 16:57:18 -04:00
urpmi Fixes for run_command shell usage in remainder of packaging modules, save portinstall. 2014-03-12 16:57:18 -04:00
yum In the yum module example, use present/absent instead of installed/removed 2014-06-25 23:21:43 +09:00
zypper remove check for version string 2014-02-12 17:14:43 +01:00
zypper_repository Correctly handle .repo files in zypper_repository module 2014-06-26 13:17:27 -07:00