Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable action validation with tasks by default #1377

Merged
merged 1 commit into from Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .ansible-lint
Expand Up @@ -48,3 +48,7 @@ extra_vars:
line1
line2
complex_variable: ":{;\t$()"

# Uncomment to enforce action validation with tasks, usually is not
# needed as Ansible syntax check also covers it.
# skip_action_validation: false
1 change: 1 addition & 0 deletions src/ansiblelint/config.py
Expand Up @@ -54,6 +54,7 @@
loop_var_prefix=None,
offline=False,
extra_vars=None,
skip_action_validation=True,
)

# Used to store detected tag deprecations
Expand Down
5 changes: 4 additions & 1 deletion src/ansiblelint/utils.py
Expand Up @@ -60,6 +60,7 @@
LoadingFailureRule,
RuntimeErrorRule,
)
from ansiblelint.config import options
from ansiblelint.constants import FileType
from ansiblelint.errors import MatchError
from ansiblelint.file_utils import Lintable, get_yaml_files
Expand Down Expand Up @@ -516,7 +517,9 @@ def normalize_task_v2(task: Dict[str, Any]) -> Dict[str, Any]:
sanitized_task = _sanitize_task(task)
mod_arg_parser = ModuleArgsParser(sanitized_task)
try:
action, arguments, result['delegate_to'] = mod_arg_parser.parse()
action, arguments, result['delegate_to'] = mod_arg_parser.parse(
skip_action_validation=options.skip_action_validation
)
except AnsibleParserError as e:
raise MatchError(
rule=AnsibleParserErrorRule(),
Expand Down