Playbooks define automation workflows. Here is the structure you'll use.
---
- name: Configure VLANs on switches
hosts: switches
gather_facts: no
tasks:
- name: Create VLAN 100
cisco.ios.ios_vlans:
config:
- vlan_id: 100
name: SERVERS
state: merged
Playbook elements:
- name: Describes what the playbook does
- hosts: Which inventory group to target
- gather_facts: Whether to collect device information first
- tasks: List of actions to perform