Not the same behaviour using wildcards on arguments #2085
-
SummaryNot the same behaviour using wildcards on arguments Issue Type
Ansible and Ansible Lint details$ ansible --version
ansible 2.10.17
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/julian.sotoca/ansible/library']
ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
$ ansible-lint --version
ansible-lint 5.3.2 using ansible 2.10.17
OS / ENVIRONMENTUbuntu 20.04 STEPS TO REPRODUCEIf we run ansible-lint -p some_playbook.yml and ansible-lint -p some_playbook*.yml we got different output $ ansible-lint -p my_playbook.yml
WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: my_playbook.yml
WARNING Listing 268 violation(s) that are fatal
get-vault-keys.yml:8: unnamed-task All tasks should be named
roles/my_role/meta/main.yml:27: yaml missing starting space in comment (comments)
roles/my_role/meta/main.yml:35: yaml missing starting space in comment (comments)
roles/my_role/meta/main.yml:41: yaml missing starting space in comment (comments)
roles/my_role/meta/main.yml:45: yaml missing starting space in comment (comments)
roles/my_role/meta/main.yml:53: yaml missing starting space in comment (comments)
roles/my_role/meta/main.yml:64: yaml missing starting space in comment (comments)
....
my_playbook.yml:130: unnamed-task All tasks should be named
You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list: # or 'skip_list' to silence them completely
- command-instead-of-module # Using command rather than module
- empty-string-compare # Don't compare to empty string
- experimental # all rules tagged as experimental
- no-changed-when # Commands should not change things if nothing needs doing
- no-jinja-nesting # Nested jinja pattern
- package-latest # Package installs should not use latest
- risky-shell-pipe # Shells that use pipes should set the pipefail option
- unnamed-task # All tasks should be named
- yaml # Violations reported by yamllint
Finished with 238 failure(s), 30 warning(s) on 86 files.
$ ansible-lint -p my_playbook*.yml
WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: my_playbook.yml
WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: my_playbook_abc.yml
WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: my_playbook_iis_server.yml
WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: my_playbook_without_vault.yml
WARNING Listing 1 violation(s) that are fatal
roles/nodejs/tasks/main.yml:65:5: syntax-check couldn't resolve module/action 'win_chocolatey'. This often indicates a misspelling, missing collection, or incorrect module path.
Finished with 1 failure(s), 0 warning(s) on 4 files.
Desired BehaviorBoth command return the same output with the 238 failures. Possible security bugs should be reported via email to Actual BehaviorIf we want to use a wildcard as the argument we only get syntax-check errors. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Not a bug, wildcards are expanded by shell and the behavior is well documented. Any argument is assumed to be a playbook. |
Beta Was this translation helpful? Give feedback.
Not a bug, wildcards are expanded by shell and the behavior is well documented. Any argument is assumed to be a playbook.