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

Docs: Add MD for only-builtins rule #2555

Merged
merged 3 commits into from
Oct 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/ansiblelint/rules/only_builtins.md
Original file line number Diff line number Diff line change
@@ -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.
```