Skip to content

Commit

Permalink
First beta release
Browse files Browse the repository at this point in the history
NOTE: This release is not compatible with earlier releases due to changes in the underlying data structure.

Changes:

1. Converted entries in roles/ndfc_common/vars/main.yml from lists to dictionaries.  With dictionaries, entries can be reordered without ill effects.

2. Removed several roles, including:

ndfc_device_query - Replaced with ndfc_device_info_get
ndfc_device_query_all - No replacement. The same result can be obtained with ndfc_device_info_get
ndfc_network_deleted_all - Replaced with ndfc_*_network_deleted_all (see below)
ndfc_policy_vrf_rt_import   - Replaced with ndfc_policy_vrf_rt_import_evpn
ndfc_policy_vrf_rt_import_loop - Replaced with ndfc_policy_vrf_rt_import_evpn_loop

3. Renamed roles and their corresponding playbooks:

ndfc_rest_fabric_create -> ndfc_rest_fabric_switch_create

4. Added several roles, including

ndfc_device_config_get - retrieve locally-defined configuration for device
ndfc_device_info_get - retrieve remote (NDFC) configuration for device
ndfc_device_ipv4_address_local_get - retrieve locally-defined device ipv4_address
ndfc_device_ipv4_address_remote_get - retrieve remote (NDFC) value for device ipv4_address
ndfc_fabric_config_get - retrieve locally-defined configuration for fabric
ndfc_network_config_get - retrieve locally-defined configuration for network
ndfc_network_deleted_external_fabric_all - delete all networks in an external fabric
ndfc_network_deleted_msd_fabric_all - delete all networks in a msd fabric
ndfc_network_deleted_switch_fabric_all - delete all networks in a switch fabric
ndfc_rest_fabric_active_fabrics_get - return list of active fabrics
ndfc_vrf_config_get - retrieve locally-defined configuration for vrf

5. All roles saw some changes to accommodate the new data structure and many roles were simplified.

6. Renamed playbook:

example_ndfc_rest_fabric_create_msd_with_children.yml -> example_ndfc_rest_fabric_msd_create_with_children.yml
  • Loading branch information
allenrobel committed Aug 18, 2022
1 parent 33164a3 commit 80e340f
Show file tree
Hide file tree
Showing 160 changed files with 2,088 additions and 1,875 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Two identical child fabrics and a multisite domain (MSD) fabric are defined in t
The main playbooks, which create the two fabrics and the MSD fabric are located in the top-level directory:

```bash
example_ndfc_rest_fabric_create_f1.yml
example_ndfc_rest_fabric_create_f2.yml
example_ndfc_rest_fabric_create_msd_with_children.yml
example_ndfc_rest_fabric_switch_create_f1.yml
example_ndfc_rest_fabric_switch_create_f2.yml
example_ndfc_rest_fabric_msd_create_with_children.yml
```

Ref | Playbook | Description
--- | -------- | -----------
1 | ``example_ndfc_rest_fabric_create_f1.yml`` | creates VXLAN/EVPN fabric f1 without connectivity to an MSD fabric
2 | ``example_ndfc_rest_fabric_create_f2.yml`` | creates VXLAN/EVPN fabric f2 without connectivity to an MSD fabric
3 | ``example_ndfc_rest_fabric_create_msd_with_children.yml`` | creates VXLAN/EVPN fabrics f1 and f2, connecting them through an MSD fabric
1 | ``example_ndfc_rest_fabric_switch_create_f1.yml`` | creates VXLAN/EVPN fabric f1 without connectivity to an MSD fabric
2 | ``example_ndfc_rest_fabric_switch_create_f2.yml`` | creates VXLAN/EVPN fabric f2 without connectivity to an MSD fabric
3 | ``example_ndfc_rest_fabric_msd_create_with_children.yml`` | creates VXLAN/EVPN fabrics f1 and f2, connecting them through an MSD fabric

Hence, you should use either (1 and 2) OR 3 (which creates 1 and 2, but with MSD connectivity). That is, (1 and 2) are mutually exclusive to 3.

Expand All @@ -29,7 +29,7 @@ These playbooks leverage the following included Roles:
```bash
ndfc_rest_config_deploy_all
ndfc_device_merged
ndfc_rest_fabric_create
ndfc_rest_fabric_switch_create
ndfc_network_replaced_all
ndfc_policy_vrf_rt_import_loop
ndfc_rest_vpc_create
Expand Down Expand Up @@ -200,7 +200,7 @@ ndfc:

```bash
cd /top/level/directory/for/this/repo
ansible-playbook example_ndfc_rest_fabric_create_f1.yml --ask-vault-pass -i inventory
ansible-playbook example_ndfc_rest_fabric_switch_create_f1.yml --ask-vault-pass -i inventory
```

When prompted, enter the password you used in response to the ansible-vault command in step 1 above.
Expand All @@ -209,7 +209,7 @@ When prompted, enter the password you used in response to the ansible-vault comm

```bash
cd /top/level/directory/for/this/repo
ansible-playbook example_ndfc_rest_fabric_create_f1.yml -i inventory
ansible-playbook example_ndfc_rest_fabric_switch_create_f1.yml -i inventory
```

## Roles
Expand Down Expand Up @@ -253,7 +253,7 @@ Role | Description
[ndfc_rest_fabric_access_mode_get] | Retrieve a fabric's access mode, given ``fabric_name``
[ndfc_rest_fabric_access_mode_set] | Set a fabric's access mode, given ``fabric_name``, and ``read_only``
[ndfc_rest_fabric_asn_get] | Retrieve a fabric's BGP ASN, given ``fabric_name``
[ndfc_rest_fabric_create] | Create a fabric, given ``fabric_name``
[ndfc_rest_fabric_switch_create] | Create a switch fabric, given ``fabric_name``
[ndfc_rest_fabric_delete] | Delete a fabric, given ``fabric_name``
[ndfc_rest_fabric_external_create] | Create an external fabric, given ``fabric_name``
[ndfc_rest_fabric_msd_child_add] | Add a child fabric to an MSD fabric, given ``child_fabric``, and ``msd_fabric``
Expand Down Expand Up @@ -305,7 +305,7 @@ Role | Description
[ndfc_rest_fabric_access_mode_get]: https://github.com/allenrobel/ndfc-roles/tree/master/roles/ndfc_rest_fabric_access_mode_get
[ndfc_rest_fabric_access_mode_set]: https://github.com/allenrobel/ndfc-roles/tree/master/roles/ndfc_rest_fabric_access_mode_set
[ndfc_rest_fabric_asn_get]: https://github.com/allenrobel/ndfc-roles/tree/master/roles/ndfc_rest_fabric_asn_get
[ndfc_rest_fabric_create]: https://github.com/allenrobel/ndfc-roles/tree/master/roles/ndfc_rest_fabric_create
[ndfc_rest_fabric_switch_create]: https://github.com/allenrobel/ndfc-roles/tree/master/roles/ndfc_rest_fabric_switch_create
[ndfc_rest_fabric_delete]: https://github.com/allenrobel/ndfc-roles/tree/master/roles/ndfc_rest_fabric_delete
[ndfc_rest_fabric_external_create]: https://github.com/allenrobel/ndfc-roles/tree/master/roles/ndfc_rest_fabric_external_create
[ndfc_rest_fabric_msd_child_add]: https://github.com/allenrobel/ndfc-roles/tree/master/roles/ndfc_rest_fabric_msd_child_add
Expand Down
13 changes: 13 additions & 0 deletions example_ndfc_device_config_get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# example_ndfc_device_config_get.yml
# Query local vars for device configuration
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_device_config_get
vars:
device_name: leaf_1
tasks:
- block:
- debug:
msg: "device_config: {{ device_config }}"
14 changes: 14 additions & 0 deletions example_ndfc_device_generated_configs_get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# example_ndfc_device_generated_configs_get.yml
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_device_generated_configs_get
vars:
fabric_name: f1
device_name: leaf_1
tasks:
- block:
- debug:
var: device_generated_configs
when: "device_generated_configs != ''"
16 changes: 16 additions & 0 deletions example_ndfc_device_ipv4_address_local_get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# example_ndfc_device_ipv4_address_local_get.yml
# Query device entry in ndfc_common with fabric_name and device_name
# and print the switch's ipv4 address based on the vars config in ndfc_common
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_device_ipv4_address_local_get
vars:
fabric_name: f2
device_name: leaf_1
tasks:
- block:
- debug:
msg: "device_ipv4_address: {{ device_ipv4_address }}"
when: "device_ipv4_address != ''"
16 changes: 16 additions & 0 deletions example_ndfc_device_ipv4_address_remote_get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# example_ndfc_device_ipv4_address_remote_get.yml
# Query NX-OS switch associated with fabric_name and device_name
# and print the switch's ipv4 address based on remote device's configuration
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_device_ipv4_address_remote_get
vars:
fabric_name: f2
device_name: leaf_1
tasks:
- block:
- debug:
msg: "device_ipv4_address: {{ device_ipv4_address }}"
when: "device_ipv4_address != ''"
2 changes: 0 additions & 2 deletions example_ndfc_device_merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@
vars:
fabric_name: f1
device_name: spine_1
# Default is true. See README for ndfc_device_merged Role
config_deploy_for_existing_device: true
3 changes: 1 addition & 2 deletions example_ndfc_device_serial_number_get.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
roles:
- ndfc_device_serial_number_get
vars:
fabric_name: f2
device_name: leaf_1
device_name: leaf_5
tasks:
- block:
- debug:
Expand Down
13 changes: 13 additions & 0 deletions example_ndfc_fabric_config_get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# example_ndfc_fabric_config_get.yml
# Query local vars for fabric configuration
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_fabric_config_get
vars:
fabric_name: f1
tasks:
- block:
- debug:
msg: "fabric_config: {{ fabric_config }}"
13 changes: 13 additions & 0 deletions example_ndfc_network_config_get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# example_ndfc_network_config_get.yml
# Retrieve configuration of network_name from vars defined in ndfc_common
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_network_config_get
vars:
network_name: f1_n1111
tasks:
- block:
- debug:
msg: "network_config: {{ network_config }}"
3 changes: 1 addition & 2 deletions example_ndfc_network_deleted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
roles:
- ndfc_network_deleted
vars:
fabric_name: MSD
network_name: n1111
network_name: msd_n1111
11 changes: 0 additions & 11 deletions example_ndfc_network_deleted_all.yml

This file was deleted.

8 changes: 8 additions & 0 deletions example_ndfc_network_deleted_external_fabric_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# example_ndfc_network_deleted_external_fabric_all.yml
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_network_deleted_external_fabric_all
vars:
fabric_name: external
8 changes: 8 additions & 0 deletions example_ndfc_network_deleted_msd_fabric_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# example_ndfc_network_deleted_msd_fabric_all.yml
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_network_deleted_msd_fabric_all
vars:
fabric_name: MSD
8 changes: 8 additions & 0 deletions example_ndfc_network_deleted_switch_fabric_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# example_ndfc_network_deleted_switch_fabric_all.yml
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_network_deleted_switch_fabric_all
vars:
fabric_name: f1
7 changes: 7 additions & 0 deletions example_ndfc_network_replaced.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_network_replaced
vars:
network_name: f1_n1111
2 changes: 1 addition & 1 deletion example_ndfc_network_replaced_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
roles:
- ndfc_network_replaced_all
vars:
fabric_name: f1
fabric_name: MSD
3 changes: 1 addition & 2 deletions example_ndfc_policy_vrf_rt_import_evpn_loop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
- ndfc_policy_vrf_rt_import_evpn_loop
vars:
fabric_name: f1
device_name: leaf_1
vrf_name: v1
import_vrf_name: v2
state: merged
devices:
device_list:
- leaf_1
- leaf_2
- leaf_3
Expand Down
1 change: 0 additions & 1 deletion example_ndfc_rest_device_set_role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
roles:
- ndfc_rest_device_set_role
vars:
fabric_name: f1
device_name: leaf_1
role: leaf
4 changes: 4 additions & 0 deletions example_ndfc_rest_fabric_access_mode_get.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
- ndfc_rest_fabric_access_mode_get
vars:
fabric_name: f1
tasks:
- block:
- debug:
msg: "fabric {{ fabric_name }} read_only: {{ read_only }}"
13 changes: 13 additions & 0 deletions example_ndfc_rest_fabric_active_fabrics_get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# example_ndfc_device_serial_number_get.yml
# Query NX-OS switch associated with fabric_name and device_name
# and print the switch's serial number
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_rest_fabric_active_fabrics_get
tasks:
- block:
- debug:
msg: "active_fabrics: {{ active_fabrics }}"
when: "active_fabrics != ''"
8 changes: 0 additions & 8 deletions example_ndfc_rest_fabric_create.yml

This file was deleted.

2 changes: 1 addition & 1 deletion example_ndfc_rest_fabric_delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
roles:
- ndfc_rest_fabric_delete
vars:
fabric_name: f1
fabric_name: f3
2 changes: 1 addition & 1 deletion example_ndfc_rest_fabric_external_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
roles:
- ndfc_rest_fabric_external_create
vars:
fabric_name: sn_fabric_1
fabric_name: ext_fabric_test
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# example_ndfc_rest_fabric_create_msd_with_children.yml
# example_ndfc_rest_fabric_msd_create_with_children.yml
---
# Fabric f1 and devices
- hosts: ndfc
gather_facts: false
roles:
- ndfc_rest_fabric_create
- ndfc_rest_fabric_switch_create
vars:
fabric_name: f1

Expand Down Expand Up @@ -144,7 +144,7 @@
- hosts: ndfc
gather_facts: false
roles:
- ndfc_rest_fabric_create
- ndfc_rest_fabric_switch_create
vars:
fabric_name: f2

Expand Down
8 changes: 8 additions & 0 deletions example_ndfc_rest_fabric_switch_create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# example_ndfc_rest_fabric_switch_create.yml
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_rest_fabric_switch_create
vars:
fabric_name: f1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# example_ndfc_rest_fabric_create_f1.yml
# example_ndfc_rest_fabric_switch_create_f1.yml
# This creates a standalone fabric (i.e. not MSD child). As such, it provisions only the leaf and spine layers (does not provision border-gateways)
---
# Fabric and devices
- hosts: ndfc
gather_facts: false
roles:
- ndfc_rest_fabric_create
- ndfc_rest_fabric_switch_create
vars:
fabric_name: f1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# example_ndfc_rest_fabric_create_f2.yml
# example_ndfc_rest_fabric_switch_create_f2.yml
# This creates a standalone fabric (i.e. not MSD child). As such, it provisions only the leaf and spine layers (does not provision border-gateways)
---
# Fabric and devices
- hosts: ndfc
gather_facts: false
roles:
- ndfc_rest_fabric_create
- ndfc_rest_fabric_switch_create
vars:
fabric_name: f2

Expand Down
5 changes: 2 additions & 3 deletions example_ndfc_rest_interface_no_shutdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
roles:
- ndfc_rest_interface_no_shutdown
vars:
- fabric_name: f1
device_name: leaf_1
interface_name: Ethernet1/49
device_name: spine_1
interface_name: Ethernet1/32
1 change: 0 additions & 1 deletion example_ndfc_vpc_interface_merged_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
roles:
- ndfc_vpc_interface_merged_all
vars:
fabric_name: f1
vpc_name: vpc1
13 changes: 13 additions & 0 deletions example_ndfc_vrf_config_get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# example_ndfc_vrf_config_get.yml
# Query local vars for vrf configuration
---
- hosts: ndfc
gather_facts: false
roles:
- ndfc_vrf_config_get
vars:
vrf_name: msd_v1
tasks:
- block:
- debug:
msg: "vrf_config: {{ vrf_config }}"
Loading

0 comments on commit 80e340f

Please sign in to comment.