Skip to content

Commit

Permalink
Fix --force for unversionned requirements
Browse files Browse the repository at this point in the history
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:
  ansible#11266 (comment)

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 ansible#12904
  • Loading branch information
mscherer committed Apr 7, 2017
1 parent e66c982 commit f7593f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ansible/cli/galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,9 @@ def execute_install(self):
(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()
Expand Down

0 comments on commit f7593f7

Please sign in to comment.