Skip to content

Commit 37e04ea

Browse files
authored
deprecated-module: add documentation (#2377)
* md doc for deprecated_module
1 parent 25302dc commit 37e04ea

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# deprecated-module
2+
3+
This rule identifies deprecated modules in playbooks.
4+
You should avoid using deprecated modules because they are not maintained, which can pose a security risk.
5+
Additionally when a module is deprecated it is available temporarily with a plan for future removal.
6+
7+
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.
8+
9+
## Problematic Code
10+
11+
```yaml
12+
---
13+
- name: Example playbook
14+
hosts: localhost
15+
tasks:
16+
- name: Configure VLAN ID
17+
ansible.netcommon.net_vlan: # <-- This module is deprecated.
18+
vlan_id: 20
19+
```
20+
21+
## Correct Code
22+
23+
```yaml
24+
---
25+
- name: Example playbook
26+
hosts: localhost
27+
tasks:
28+
- name: Configure VLAN ID
29+
dellemc.enterprise_sonic.sonic_vlans: # <-- Use a platform specific module.
30+
config:
31+
- vlan_id: 20
32+
```

0 commit comments

Comments
 (0)