Fix --force for unversionned requirements (#23391)

In current stable (2.2), ansible galaxy install --force do erase
a role, even if the version is not set. This commit should restore
that specific behavior, in accordance to people reports:
  https://github.com/ansible/ansible/issues/11266#issuecomment-273801480

It was also the behavior planned in the initial discussion:
"if you're not fixing versions in your roles file, then it's fine
to expect that the role will be reinstalled each time you run
ansible-galaxy install.", cf https://github.com/ansible/ansible/pull/12904
(cherry picked from commit 78836ec0b9)
pull/25484/head
Michael Scherer 9 years ago committed by Toshio Kuratomi
parent ba6276a4b1
commit e4fae653da

@ -379,8 +379,9 @@ class GalaxyCLI(CLI):
(role.name, role.install_info['version'], role.version or "unspecified"))
continue
else:
display.display('- %s is already installed, skipping.' % str(role))
continue
if not force:
display.display('- %s is already installed, skipping.' % str(role))
continue
try:
installed = role.install()

Loading…
Cancel
Save