From 69b1f21981c86afdb906b157757c6f43ff56e99e Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 19 Aug 2021 18:20:37 +0100 Subject: [PATCH] Use force for ansible-galaxy install commands (#1704) This fixed bug which affects ansible 2.9 where the install fails if an outdated version is already present. Newer versions are able to upgrade it without using force. --- src/ansiblelint/prerun.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ansiblelint/prerun.py b/src/ansiblelint/prerun.py index 1471ae6427..0abf82722c 100644 --- a/src/ansiblelint/prerun.py +++ b/src/ansiblelint/prerun.py @@ -106,6 +106,7 @@ def install_collection(collection: str, destination: Optional[str] = None) -> No "ansible-galaxy", "collection", "install", + "--force", # required for ansible 2.9 "-v", ] if destination: @@ -140,6 +141,7 @@ def install_requirements(requirement: str) -> None: "ansible-galaxy", "role", "install", + "--force", # required for ansible 2.9 "--roles-path", f"{options.cache_dir}/roles", "-vr", @@ -165,6 +167,7 @@ def install_requirements(requirement: str) -> None: "ansible-galaxy", "collection", "install", + "--force", # required for ansible 2.9 "-p", f"{options.cache_dir}/collections", "-vr",