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-module: add documentation #2377

Merged
merged 2 commits into from
Sep 1, 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_module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# deprecated-module

This rule identifies deprecated modules in playbooks.
You should avoid using deprecated modules because they are not maintained, which can pose a security risk.
Additionally when a module is deprecated it is available temporarily with a plan for future removal.

Refer to the [Ansible module index](https://docs.ansible.com/ansible/latest/collections/index_module.html) for information about replacements and removal dates for deprecated modules.

## Problematic Code

```yaml
---
- name: Example playbook
hosts: localhost
tasks:
- name: Configure VLAN ID
ansible.netcommon.net_vlan: # <-- This module is deprecated.
vlan_id: 20
```

## Correct Code

```yaml
---
- name: Example playbook
hosts: localhost
tasks:
- name: Configure VLAN ID
dellemc.enterprise_sonic.sonic_vlans: # <-- Use a platform specific module.
config:
- vlan_id: 20
```