-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Federated fabric initial overlay management #205
Draft
mthurstocisco
wants to merge
28
commits into
develop
Choose a base branch
from
federated_fabric
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,170
−100
Draft
Changes from 16 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
45ca203
inital changes to support pre provisioned switches and links
mthurstocisco 7fb269e
Added support for the VRF loopback ID and IP assignments
mthurstocisco 4e02d85
Merge branch 'develop' into Pete&Matt
mthurstocisco 1863fd7
removed whitespace
mthurstocisco f047b32
test
mthurstocisco 5b1251c
Refactored links addition
mthurstocisco cc5a19f
fixed typo
mthurstocisco 1ae1537
Fixed a further typo
mthurstocisco 26b057a
Added additional clauses to catch apparent NDFC bug
mthurstocisco db355ac
Changed IP address for VRF loopback names to show ipv4 and ipv6
mthurstocisco c073cf5
Added fabric links create required to main.yaml in create
mthurstocisco ca12007
updates to turn on virtual peer link for vpc pairs
mthurstocisco c27e13b
Merge branch 'develop' into Pete&Matt
mthurstocisco 9d1aa85
many changes made for federated fabric overlay management
mthurstocisco c0bf452
update to only add POAP section inventory if POAP exists in new Schema
mthurstocisco 7eb2582
Merge branch 'Pete&Matt' into federated_fabric
mthurstocisco 5670890
updates to structure so main is where fed and none fed fabrics branch
mthurstocisco 5a27329
Pete&matt (#218)
mthurstocisco 78a715b
Revert "Pete&matt (#218)" (#219)
mthurstocisco 0dc816c
Reapply "Pete&matt (#218)" (#219)
mthurstocisco 8d68eed
Added support for save and deploy using federated onemanage
mthurstocisco c0d835a
Latest fixes
mthurstocisco 2ee4103
Allowing for updates to networks and VRFs
mthurstocisco c0bddfe
Fixed issues with defaults and support for ToR
mthurstocisco b6f6a39
Merge branch 'develop' into federated_fabric
mthurstocisco 2e7b15c
removed whitespace bug and old fix for tags issue
mthurstocisco 922d5ca
Merge branch 'federated_fabric' of https://github.com/netascode/ansib…
mthurstocisco 6157db2
fixed prep_103 to support topology not exising for fed fabrics
mthurstocisco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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
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
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,82 @@ | ||
# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
# this software and associated documentation files (the "Software"), to deal in | ||
# the Software without restriction, including without limitation the rights to | ||
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
# the Software, and to permit persons to whom the Software is furnished to do so, | ||
# subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
--- | ||
- name: Initialize changes_detected Var | ||
ansible.builtin.set_fact: | ||
changes_detected_fabric_links: false | ||
delegate_to: localhost | ||
|
||
- name: Set file_name Var | ||
ansible.builtin.set_fact: | ||
file_name: "{{ MD.vxlan.global.name }}_ndfc_fabric_links.yml" | ||
delegate_to: localhost | ||
|
||
- name: Stat Previous File If It Exists | ||
ansible.builtin.stat: | ||
path: "{{ role_path }}/files/{{ file_name }}" | ||
register: data_file_previous | ||
delegate_to: localhost | ||
|
||
- name: Backup Previous Data File If It Exists | ||
ansible.builtin.copy: | ||
src: "{{ role_path }}/files/{{ file_name }}" | ||
dest: "{{ role_path }}/files/{{ file_name }}.old" | ||
when: data_file_previous.stat.exists | ||
|
||
- name: Delete Previous Data File If It Exists | ||
ansible.builtin.file: | ||
state: absent | ||
path: "{{ role_path }}/files/{{ file_name }}" | ||
delegate_to: localhost | ||
when: data_file_previous.stat.exists | ||
|
||
- name: Build Fabric Links | ||
ansible.builtin.template: | ||
src: ndfc_fabric_links.j2 | ||
dest: "{{ role_path }}/files/{{ file_name }}" | ||
delegate_to: localhost | ||
|
||
- name: Set fabric_links Var default | ||
ansible.builtin.set_fact: | ||
fabric_links: [] | ||
delegate_to: localhost | ||
|
||
- name: Set fabric_links Var | ||
ansible.builtin.set_fact: | ||
fabric_links: "{{ lookup('file', file_name) | from_yaml }}" | ||
when: MD_Extended.vxlan.topology.fabric_links | length > 0 | ||
delegate_to: localhost | ||
|
||
- name: Diff Previous and Current Data Files | ||
cisco.nac_dc_vxlan.dtc.diff_model_changes: | ||
file_name_previous: "{{ role_path }}/files/{{ file_name }}.old" | ||
file_name_current: "{{ role_path }}/files/{{ file_name }}" | ||
register: file_diff_result | ||
delegate_to: localhost | ||
|
||
- name: Set File Change Flag Based on File Diff Result | ||
ansible.builtin.set_fact: | ||
changes_detected_fabric_links: true | ||
delegate_to: localhost | ||
when: | ||
- file_diff_result.file_data_changed | ||
- check_roles['save_previous'] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had planned to address the fact that there might not be topology data in a slightly different way. The changes are not in the
develop
branch yet but they are in ourmsd
branch. Instead of the if check here, earlier I add the following check and set the topology data to an empty dict. That way we still build out the entire structure even if it's empty.https://github.com/netascode/ansible-dc-vxlan/blob/msd/plugins/action/common/prepare_plugins/prep_001_list_defaults.py#L76