summaryrefslogtreecommitdiffstats
path: root/src/ansiblelint/rules/only_builtins.md
diff options
context:
space:
mode:
Diffstat (limited to 'src/ansiblelint/rules/only_builtins.md')
-rw-r--r--src/ansiblelint/rules/only_builtins.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/ansiblelint/rules/only_builtins.md b/src/ansiblelint/rules/only_builtins.md
new file mode 100644
index 0000000..750e194
--- /dev/null
+++ b/src/ansiblelint/rules/only_builtins.md
@@ -0,0 +1,36 @@
+# only-builtins
+
+This rule checks that playbooks use actions from the `ansible.builtin` collection only.
+
+This is an opt-in rule.
+You must enable it in your Ansible-lint configuration as follows:
+
+```yaml
+enable_list:
+ - only-builtins
+```
+
+## Problematic Code
+
+```yaml
+---
+- name: Example playbook
+ hosts: all
+ tasks:
+ - name: Deploy a Helm chart for Prometheus
+ kubernetes.core.helm: # <- Uses a non-builtin collection.
+ name: test
+ chart_ref: stable/prometheus
+ release_namespace: monitoring
+ create_namespace: true
+```
+
+## Correct Code
+
+```yaml
+- name: Example playbook
+ hosts: localhost
+ tasks:
+ - name: Run a shell command
+ ansible.builtin.shell: echo This playbook uses actions from the builtin collection only.
+```