Skip to content

Commit

Permalink
Use force for ansible-galaxy install commands (#1704)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ssbarnea committed Aug 19, 2021
1 parent 629caa7 commit 69b1f21
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ansiblelint/prerun.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 69b1f21

Please sign in to comment.