From 0f1e63b236cb422f273585f0dddec94aa1328f1d Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 3 Dec 2019 22:56:02 +0100 Subject: [PATCH] [yarn] Set name_version when version is not specified (#62348) (#65213) * Set name_version when version is not specified, fix #55097 This will default to installing the latest version available * Add changelog fragment * update changelog (cherry picked from commit 136dc27572efe61a03fcf26c9b43cafd54390597) --- changelogs/fragments/62348-yarn-no_version_install_fix.yml | 3 +++ lib/ansible/modules/packaging/language/yarn.py | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/62348-yarn-no_version_install_fix.yml diff --git a/changelogs/fragments/62348-yarn-no_version_install_fix.yml b/changelogs/fragments/62348-yarn-no_version_install_fix.yml new file mode 100644 index 00000000000..a58bfe6843a --- /dev/null +++ b/changelogs/fragments/62348-yarn-no_version_install_fix.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - yarn - handle no version when installing module by name (https://github.com/ansible/ansible/issues/55097) diff --git a/lib/ansible/modules/packaging/language/yarn.py b/lib/ansible/modules/packaging/language/yarn.py index a3b8ae276ac..aca21e7518b 100644 --- a/lib/ansible/modules/packaging/language/yarn.py +++ b/lib/ansible/modules/packaging/language/yarn.py @@ -183,6 +183,8 @@ class Yarn(object): if kwargs['version'] and self.name is not None: self.name_version = self.name + '@' + str(self.version) + elif self.name is not None: + self.name_version = self.name def _exec(self, args, run_in_check_mode=False, check_rc=True): if not self.module.check_mode or (self.module.check_mode and run_in_check_mode):