Skip to content

Commit

Permalink
feat: multiple added (#29)
Browse files Browse the repository at this point in the history
* feat: combine considering weights, file-prefix, adjustable list_key_map, and show meta data for key/value combination decisions.

* feat: code cleanup

* Updated to use a filespec list instead a a string prefix

* Replaced the ansible-based combine logic with mdd_combine module

* Changed the name of the filespec option and added the ability to change default weight

* fix: ensure path is a string

* feat: file to prefix-list in list_key_map

* feat: allow for integer list keys

* feat: updated list_key_map

* updated defaults

* undictify - empty merge_key dict now converted back to list

* raise error if error reading yaml file. Raise error if key is found multiple times at same hierarchy level

* configure "no switchport" when ip addresses added to interface

* Fixed ansible-test errors

* feat: now uses jinja2 to render config files

* Removing commented code

* Updating release version to 1.2.6

---------

Co-authored-by: Steven Carter <[email protected]>
Co-authored-by: Jason King <[email protected]>
  • Loading branch information
3 people authored Aug 2, 2023
1 parent 4e616ff commit 3cf149d
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 36 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace: ciscops
name: mdd

# The version of the collection. Must be compatible with semantic versioning
version: 1.2.5
version: 1.2.6

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
9 changes: 0 additions & 9 deletions playbooks/nso_update_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@
when: ('oc' in mdd_data_types)
throttle: "{{ workers }}"
block:
# - name: Combine Device Data with OC Data
# ansible.builtin.set_fact:
# nso_device_config: "{{ nso_device_config | default({}) | ansible.builtin.combine({'mdd:openconfig': mdd_data['mdd:openconfig']}) }}"

# - name: Combine Device Data with MDD Data
# set_fact:
# nso_device_config: "{{ nso_device_config | ansible.builtin.combine( { 'config': mdd_data['config'] }, recursive=true) }}"
# when: mdd_data['config'] is defined and mdd_data['mdd:openconfig'] is defined

- name: Translate and truncate interface names
set_fact:
mdd_data: "{{ mdd_data | ciscops.mdd.intf_xform(cml_intf_xlate) }}"
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/data_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
from ansible.module_utils.basic import AnsibleModule, missing_required_lib

JSONSCHEMA_IMPORT_ERROR = 0
IPADDRESS_IMPORT_ERROR = 0
YAML_IMPORT_ERROR = 0

try:
from jsonschema import Draft202012Validator
Expand Down Expand Up @@ -119,7 +119,7 @@ def main():

if not HAS_YAML:
# Needs: from ansible.module_utils.basic import missing_required_lib
module.fail_json(msg=missing_required_lib('yaml'), exception=IPADDRESS_IMPORT_ERROR)
module.fail_json(msg=missing_required_lib('yaml'), exception=YAML_IMPORT_ERROR)

data = module.params['data']
schema = {}
Expand Down
Loading

0 comments on commit 3cf149d

Please sign in to comment.