summaryrefslogtreecommitdiffstats
path: root/src/ansiblelint/rules/deprecated_command_syntax.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:56 +0000
commitd964cec5e6aa807b75c7a4e7cdc5f11e54b2eda2 (patch)
tree794bc3738a00b5e599f06d1f2f6d79048d87ff8e /src/ansiblelint/rules/deprecated_command_syntax.md
parentInitial commit. (diff)
downloadansible-lint-d964cec5e6aa807b75c7a4e7cdc5f11e54b2eda2.tar.xz
ansible-lint-d964cec5e6aa807b75c7a4e7cdc5f11e54b2eda2.zip
Adding upstream version 6.13.1.upstream/6.13.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ansiblelint/rules/deprecated_command_syntax.md')
-rw-r--r--src/ansiblelint/rules/deprecated_command_syntax.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ansiblelint/rules/deprecated_command_syntax.md b/src/ansiblelint/rules/deprecated_command_syntax.md
new file mode 100644
index 0000000..f99ca99
--- /dev/null
+++ b/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
+```