forked from rgl/ansible-collection-tp-link-easy-smart-switch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example-playbook.yml
55 lines (55 loc) · 1.74 KB
/
example-playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
- hosts: smrt_switches
name: Example
gather_facts: no
tasks:
# NB this assumes that you have taken ownership of the switch as described
# in the README.
- name: Configure the TL-SG108E switch
connection: local
rgl.tp_link_easy_smart_switch.smrt_config:
username: "{{ smrt_username }}"
password: "{{ smrt_password }}"
host_interface: "{{ smrt_host_interface }}"
switch_mac_address: "{{ smrt_switch_mac_address }}"
# NB undefined ports will be disabled and put in vlan 1 as untagged
# ports.
# NB ports that are not explicitly added in vlans will be disabled
# and put in vlan 1 as untagged ports.
# NB ports without explicit pvid will be deduced from the vlans (use
# the first vlan that has the port as an untagged port).
ports:
- port: 1
name: isp
- port: 2
name: desktop
- port: 5
name: rpi1
- port: 6
name: rpi2
- port: 7
name: rpi3
- port: 8
name: rpi4
vlans:
# NB do not remove your management computer (in this example, its in
# the desktop port) from vlan 1 because that is the only vlan
# that can manage the switch.
- vlan_id: 1
name: management
untagged_ports:
- desktop
- vlan_id: 2
name: wan
tagged_ports:
- desktop
untagged_ports:
- isp
- vlan_id: 3
name: rpi
tagged_ports:
- desktop
untagged_ports:
- rpi1
- rpi2
- rpi3
- rpi4