|
10 | 10 | ---
|
11 | 11 | - name: Enable Features
|
12 | 12 | tags: [api, nxapi, trunk, vlan]
|
13 |
| - with_items: |
| 13 | + loop: |
14 | 14 | - lacp
|
15 | 15 | nxos_feature:
|
16 |
| - provider: |
17 |
| - host: "{{inventory_hostname}}" |
18 |
| - transport: nxapi |
19 |
| - timeout: 15 |
20 | 16 | feature: "{{ item }}"
|
21 | 17 | state: enabled
|
22 | 18 |
|
23 | 19 | - name: Create Uplink Port Channel to Distribution
|
24 | 20 | tags: [api, nxapi, trunk, vlan]
|
25 |
| - with_items: "{{ uplinks }}" |
26 |
| - nxos_portchannel: |
27 |
| - provider: |
28 |
| - host: "{{inventory_hostname}}" |
29 |
| - transport: nxapi |
30 |
| - timeout: 15 |
31 |
| - group: "{{ item.port_channel_id }}" |
32 |
| - members: "{{ item.members }}" |
33 |
| - force: true |
34 |
| - mode: on |
35 |
| - state: present |
| 21 | + loop: "{{ uplinks }}" |
| 22 | + nxos_lag_interfaces: |
| 23 | + config: |
| 24 | + - name: "port-channel{{ item.port_channel_id }}" |
| 25 | + members: |
| 26 | + - member: "{{ item.members.0 }}" |
| 27 | + mode: active |
| 28 | + - member: "{{ item.members.1 }}" |
| 29 | + mode: active |
| 30 | + |
| 31 | +- name: Make Port Channel Layer 2 |
| 32 | + tags: [api, nxapi, vpc] |
| 33 | + loop: "{{ uplinks }}" |
| 34 | + nxos_interfaces: |
| 35 | + config: |
| 36 | + - name: "port-channel{{ item.port_channel_id }}" |
| 37 | + enabled: true |
| 38 | + mode: layer2 |
| 39 | + |
| 40 | +# BUG: The nxos_l2_interfaces module should be able to configure |
| 41 | +# an interface as a trunk. However testing showed it isn't working |
| 42 | +# in the current version of Ansible. Therefore the nxos_config module |
| 43 | +# is used here to configure correctly. |
| 44 | +- name: Configure Port Channel Trunk |
| 45 | + tags: [api, nxapi, vpc] |
| 46 | + loop: "{{ uplinks }}" |
| 47 | + nxos_config: |
| 48 | + lines: |
| 49 | + - switchport mode trunk |
| 50 | + parents: interface port-channel{{ item.port_channel_id }} |
36 | 51 |
|
37 |
| -- name: Configure Uplink Port Channels as Trunk |
38 |
| - tags: [api, nxapi, trunk, vlan] |
39 |
| - with_items: "{{ uplinks }}" |
40 |
| - nxos_switchport: |
41 |
| - provider: |
42 |
| - host: "{{inventory_hostname}}" |
43 |
| - transport: nxapi |
44 |
| - timeout: 15 |
45 |
| - interface: "po{{ item.port_channel_id }}" |
46 |
| - mode: trunk |
|
0 commit comments