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

deprecated-command: add documentation #2360

Merged
merged 1 commit into from
Aug 29, 2022
Merged
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
32 changes: 32 additions & 0 deletions src/ansiblelint/rules/deprecated_command_syntax.md
@@ -0,0 +1,32 @@
# deprecated-command-syntax

This rule identifies the use of shorthand (free-form) syntax as this is highly
discouraged inside playbooks, mainly because it can easily lead to bugs that
are hard to identify.

While using the free-form from the command line is ok, it should never be used
inside playbooks.

# Problematic Code

```yaml
---
- name: Example playbook
hosts: localhost
tasks:
- name: Perform chmod
ansible.builtin.command: creates=B chmod 644 A # <-- do not use shorthand
```

# Correct Code

```yaml
---
- name: Example playbook
hosts: localhost
tasks:
- name: Perform chmod
ansible.builtin.command: chmod 644 A
args:
creates: B
```