Skip to content
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

Release 0.2.0 #144

Merged
merged 34 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
dc9db28
Update README.md
mikewiebe Jun 10, 2024
0c396bf
Galaxy fix for prepare files
mikewiebe Jun 10, 2024
c833390
Galaxy fix for prepare files
mikewiebe Jun 10, 2024
bd59658
Add meta runtime
mikewiebe Jun 10, 2024
5f531df
update task and action plugin for schema lookup
mtarking Jun 15, 2024
02e23e4
update new tasks names and cleanup a few other task names
mtarking Jun 15, 2024
69b029e
Merge pull request #123 from netascode/update_schema_lookup
mikewiebe Jun 17, 2024
7afe001
updates for border_gateway
juburnet Jun 17, 2024
461faf8
update fabric_vars_example for border_gateway
juburnet Jun 17, 2024
296a274
Merge pull request #124 from juburnet/updates-for-border_gateway
mikewiebe Jun 17, 2024
b5bcf45
Update README.md
juburnet Jun 18, 2024
39a3bdb
Update README.md
juburnet Jun 18, 2024
c0e3c5c
updates for border_spine test (#129)
juburnet Jun 20, 2024
2414269
Update to use delegate_to localhost (#126)
mtarking Jun 21, 2024
c33b424
updates for SHA auth proto for integration tests (#130)
juburnet Jun 21, 2024
b9d7d31
update defaults & vrf j2 template (#131)
mtarking Jun 21, 2024
6e3314a
update topology and overlay_services to empty dicts (#132)
mtarking Jun 21, 2024
f34e82c
Update networks template (#134)
mtarking Jun 24, 2024
e708e7e
Back-out topology defaulting (#136)
mtarking Jun 24, 2024
5ca6aa8
Fix test/integration data for network.yaml (#137)
rrahimm Jun 25, 2024
8fa1c2f
remove trailing whitespace
mtarking Jun 25, 2024
4a79868
Vrfs.yaml and default updates tests-integration folder (#138)
juburnet Jun 26, 2024
793fb85
Fix for Issue 112 (#139)
mtarking Jun 26, 2024
2bf89a5
remove dns & ntp (#141)
mtarking Jun 26, 2024
7801c2e
Add Syslog to Fabric Template (#142)
mtarking Jun 26, 2024
1174487
Update readme for create and deploy roles (#140)
mtarking Jun 27, 2024
d3e32fa
add validate as dependency to create, deploy & remove (#143)
mtarking Jun 27, 2024
060a4de
Get Credentials and Remove Role Fixes (#125)
mikewiebe Jun 28, 2024
afbb861
Update CHANGELOG.rst
mikewiebe Jun 28, 2024
413f85c
Update galaxy.yml to 0.2.0
mikewiebe Jun 28, 2024
4fd8a9e
Update README.md
mikewiebe Jun 28, 2024
c2a5570
Support for Ansible Tags (#133)
mikewiebe Jun 28, 2024
693f77e
Update CHANGELOG.rst
mikewiebe Jun 28, 2024
04ba471
Merge branch 'main' into release_0.2.0
mikewiebe Jun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,5 @@ roles/validate/files/schema.yaml
!roles/validate/files/rules/enhanced_rules/.gitkeep
!roles/validate/files/rules/required_rules/*
roles/validate/defaults/*
*service_model_extended*.json
*service_model_golden*.json
29 changes: 29 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,34 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.

.. contents:: ``Release Versions``

`0.2.0`_
=====================

**Release Date:** ``2024-06-28``

Added
-----

* Support for the following device inventory roles. Only applies to adding devices to a fabric with these role types.
- border_spine
- border_gateway
- border_gateway_spine
- super_spine
- border_super_spine
- border_gateway_super_spine
* Added SysLog Server Support - Fabric Creation Stage
* Added DHCP Support and Secondary IP Address Support - Network Creation Stage
* Support for Ansible Tags
- Tags to limit execution and target specific roles in the collection
- Tags to limit execution and target specific stages inside a role

Fixed
-----
- https://github.com/netascode/ansible-dc-vxlan/issues/111
- https://github.com/netascode/ansible-dc-vxlan/issues/112
- https://github.com/netascode/ansible-dc-vxlan/issues/127
- https://github.com/netascode/ansible-dc-vxlan/issues/135

`0.1.0`_
=====================

Expand All @@ -28,4 +56,5 @@ The following roles have been added to the collection:

This version of the collection includes support for an IPv4 Underlay only. Support for IPv6 Underlay will be available in the next release.

.. _0.2.0: https://github.com/netascode/ansible-dc-vxlan/compare/0.1.0...0.2.0
.. _0.1.0: https://github.com/netascode/ansible-dc-vxlan/compare/0.1.0...0.1.0
153 changes: 88 additions & 65 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: cisco
name: nac_dc_vxlan
version: 0.1.0
version: 0.2.0
readme: README.md
authors:
- Devendra Gupta <devegupt>
Expand Down
20 changes: 11 additions & 9 deletions plugins/action/common/get_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@
class ActionModule(ActionBase):

def run(self, tmp=None, task_vars=None):
# self._supports_async = True
results = super(ActionModule, self).run(tmp, task_vars)
results['failed'] = False
results['retrieve_failed'] = False

inv_list = self._task.args['inv_list']
username = task_vars.get('ndfc_device_username')
password = task_vars.get('ndfc_device_password')
key_username = 'ndfc_switch_username'
key_password = 'ndfc_switch_password'

ndfc_host_name = task_vars['inventory_hostname']
username = task_vars['hostvars'][ndfc_host_name].get(key_username, '')
password = task_vars['hostvars'][ndfc_host_name].get(key_password, '')

# Fail if username and password are not set
if username is None or password is None:
results['failed'] = True
results['msg'] = "ndfc_device_username and ndfc_device_username must be set in group_vars or as environment variables!"
# TODO: Add support for environemnt variables
if username == '' or password == '':
results['retrieve_failed'] = True
results['msg'] = "{0} and {1} must be set in group_vars or as environment variables!".format(key_username, key_password)
return results

inv_list = self._task.args['inv_list']
# Create a new list and deep copy each dict item to avoid modifying the original and dict items
updated_inv_list = []
for device in inv_list:
Expand Down
4 changes: 2 additions & 2 deletions plugins/action/common/nac_dc_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def run(self, tmp=None, task_vars=None):
mdata = self._task.args.get('mdata')

# Generate a warning if the Schema and Rules are not provided
if schema and not os.path.exists(schema):
if 'schema' in locals() and (schema == "" or not os.path.exists(schema)):
display.warning("The schema ({0}) does not appear to exist! ".format(schema))
if not os.path.exists(rules):
if 'rules' in locals() and (rules == "" or not os.path.exists(rules)):
display.warning("The rules directory ({0}) does not appear to exist! ".format(rules))
# The rules directory is considered empty if it is an empty dir or only contains the .gitkeep file
if os.path.exists(rules) and (not os.listdir(rules) or (len(os.listdir(rules)) == 1 and '.gitkeep' in os.listdir(rules))):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ def __init__(self, **kwargs):

def prepare(self):
model_data = self.kwargs['results']['model_extended']

# Loop over all the roles in vxlan.topology.switches.role
model_data['vxlan']['topology']['spine'] = {}
model_data['vxlan']['topology']['leaf'] = {}
model_data['vxlan']['topology']['border'] = {}
model_data['vxlan']['topology']['border_spine'] = {}
model_data['vxlan']['topology']['border_gateway'] = {}
model_data['vxlan']['topology']['border_gateway_spine'] = {}
model_data['vxlan']['topology']['super_spine'] = {}
model_data['vxlan']['topology']['border_super_spine'] = {}
model_data['vxlan']['topology']['border_gateway_super_spine'] = {}
model_data['vxlan']['topology']['tor'] = {}
sm_switches = model_data['vxlan']['topology']['switches']
for switch in sm_switches:
# Build list of switch IP's based on role keyed by switch name
Expand Down
52 changes: 52 additions & 0 deletions plugins/action/dtc/verify_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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

from __future__ import absolute_import, division, print_function


__metaclass__ = type

from ansible.utils.display import Display
from ansible.plugins.action import ActionBase

display = Display()


class ActionModule(ActionBase):

def run(self, tmp=None, task_vars=None):
# self._supports_async = True
results = super(ActionModule, self).run(tmp, task_vars)
results['failed'] = False

all_tags = self._task.args['all_tags']
play_tags = self._task.args['play_tags']

if 'all' in play_tags:
return results

for tag in play_tags:
if tag not in all_tags:
results['failed'] = True
results['msg'] = "Tag '{0}' not found in list of supported tags".format(tag)
results['supported_tags'] = all_tags

return results
27 changes: 27 additions & 0 deletions roles/common_global/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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: Verify User Tags
cisco.nac_dc_vxlan.dtc.verify_tags:
all_tags: "{{ nac_tags.all }}"
play_tags: "{{ ansible_run_tags }}"
tags: "{{ ansible_run_tags }}"
82 changes: 82 additions & 0 deletions roles/common_global/vars/main.yml
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

---

nac_tags:
# All Create and Remove Tags
all:
- cr_manage_fabric
- cr_manage_switches
- cr_manage_vpc_peers
- cr_manage_interfaces
- cr_manage_vrfs_networks
# -------------------------
- rr_manage_interfaces
- rr_manage_networks
- rr_manage_vrfs
- rr_manage_vpc_peers
- rr_manage_links
- rr_manage_switches
# -------------------------
- role_validate
- role_create
- role_deploy
- role_remove
# All Create Tags
create:
- cr_manage_fabric
- cr_manage_switches
- cr_manage_vpc_peers
- cr_manage_interfaces
- cr_manage_vrfs_networks
create_fabric:
- cr_manage_fabric
create_switches:
- cr_manage_switches
create_vpc_peers:
- cr_manage_vpc_peers
create_interfaces:
- cr_manage_interfaces
create_vrfs_networks:
- cr_manage_vrfs_networks
# All Remove Tags
remove:
- rr_manage_interfaces
- rr_manage_networks
- rr_manage_vrfs
- rr_manage_vpc_peers
- rr_manage_links
- rr_manage_switches
remove_interfaces:
- rr_manage_interfaces
remove_networks:
- rr_manage_networks
remove_vrfs:
- rr_manage_vrfs
remove_vpc_peers:
- rr_manage_vpc_peers
remove_links:
- rr_manage_links
remove_switches:
- rr_manage_switches


4 changes: 3 additions & 1 deletion roles/dtc/common/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ galaxy_info:
author: Cisco
description: Common infrastructure role dependency used by other roles in this collection
license: LICENSE
min_ansible_version: 2.14.15
min_ansible_version: 2.14.15

dependencies: [cisco.nac_dc_vxlan.common_global]
Loading