-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deprecated-module: add documentation (#2377)
* md doc for deprecated_module
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |