You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run ansible-playbook with an empty string ("") as argument to --limit Ansible interprets that to all hosts. I would expect running --limit "" to fail. It fails if I give no argument or a string that doesn't match anything.
This is potentially dangerous in that for instance running CI/CD jobs with a variable as argument to --limit might cause job to run on all hosts in an inventory if the variable is never populated.
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t allCONFIG_FILE() = NoneEDITOR(env: EDITOR) = nvimPAGER(env: PAGER) = /bin/sh -c "fmt -s -w 144 - | less"
OS / Environment
Debian 12
Steps to Reproduce
Run ansible-playbook -i inventory.ini --limit "" ping.yml
Summary
When I run
ansible-playbook
with an empty string (""
) as argument to--limit
Ansible interprets that to all hosts. I would expect running--limit ""
to fail. It fails if I give no argument or a string that doesn't match anything.This is potentially dangerous in that for instance running CI/CD jobs with a variable as argument to
--limit
might cause job to run on all hosts in an inventory if the variable is never populated.Issue Type
Bug Report
Component Name
core
Ansible Version
Configuration
OS / Environment
Debian 12
Steps to Reproduce
Run
ansible-playbook -i inventory.ini --limit "" ping.yml
Expected Results
I would expect running
--limit
with an empty string to fail. It fails if I give no argument or a string that doesn't match anything.Actual Results
Ansible filters nothing, and instead runs against all hosts.
Code of Conduct
The text was updated successfully, but these errors were encountered: