Skip to content

Commit

Permalink
Treat the default inventory_files as host list (ansible#4448)
Browse files Browse the repository at this point in the history
The --inventory option to the ansible-playbook executable can accept a
value that is comma-separated. This comma-separated value is presumed to
be a host list and not a list of inventory files. This was the behavior
for the inventory_files variable before 4d295e8. There wasn't a reason
for its removal and it was an oversight made.
  • Loading branch information
cavcrosby committed Dec 12, 2024
1 parent c629b23 commit 404e50d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ansiblelint/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def _get_inventory_files(self, app: App) -> list[str]:
# To avoid noisy warnings we pass localhost as current inventory:
# [WARNING]: No inventory was parsed, only implicit localhost is available
# [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
inventory_files = ["localhost"]
inventory_files = ["localhost,"]

return inventory_files

Expand Down

0 comments on commit 404e50d

Please sign in to comment.