Skip to content

Commit

Permalink
Merge pull request #165 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
Develop v6.13.3
  • Loading branch information
fmunozmiranda authored Apr 10, 2024
2 parents 234fb71 + 7df35eb commit fa3ee16
Show file tree
Hide file tree
Showing 411 changed files with 1,710 additions and 1,342 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ on:
- v[0-9]+.[0-9]+.[0-9]+
branches:
- main

workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: configure git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@bots.github.com"
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.11"
- name: Install dependencies
run: make doc-setup
- name: Build docs
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/sanity_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,40 @@ on:
pull_request:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
env:
NAMESPACE: cisco
COLLECTION_NAME: dnac
jobs:
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix
# 2.14 supports Python 3.9-3.11
# 2.15 supports Python 3.9-3.11
# 2.16 supports Python 3.10-3.12
# https://docs.ansible.com/ansible/devel/roadmap/ROADMAP_2_17.html
# milestone is 2.17 until after 2.17 branches from devel
# devel is 2.17 until 2024-04-01
sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
strategy:
matrix:
ansible:
- stable-2.14
- stable-2.15
- devel
runs-on: ubuntu-20.04
- stable-2.16
- stable-2.17
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: cisco-en-programmability/dnacenter-ansible
- name: Create directory
run: mkdir -p ./ansible_collections/${{env.NAMESPACE}}
- name: Move repository
run: mv ./cisco-en-programmability/dnacenter-ansible ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Run sanity tests
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/sanity_tests_devel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI Devel
on:
workflow_dispatch:
env:
NAMESPACE: cisco
COLLECTION_NAME: dnac
jobs:
sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
strategy:
matrix:
ansible:
- devel
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: cisco-en-programmability/dnacenter-ansible
- name: Create directory
run: mkdir -p ./ansible_collections/${{env.NAMESPACE}}
- name: Move repository
run: mv ./cisco-en-programmability/dnacenter-ansible ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Run sanity tests
run: ansible-test sanity --docker -v --color
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ The following table shows the supported versions.

| Cisco DNA Center version | Ansible "cisco.dnac" version | Python "dnacentersdk" version |
|--------------------------|------------------------------|-------------------------------|
| 2.1.1 | 3.0.0 | 2.2.5 |
| 2.2.2.3 | 3.3.1 | 2.3.3 |
| 2.2.3.3 | 6.4.0 | 2.4.11 |
| 2.3.3.0 | 6.6.4 | 2.5.5 |
| 2.3.5.3 | 6.13.0 | 2.6.0 |
| 2.1.1 | 3.0.0 | 2.2.5 |
| 2.2.2.3 | 3.3.1 | 2.3.3 |
| 2.2.3.3 | 6.4.0 | 2.4.11 |
| 2.3.3.0 | 6.6.4 | 2.5.5 |
| 2.3.5.3 | ^6.13.0 | ^2.6.0 |

If your Ansible collection is older please consider updating it first.

Expand All @@ -44,9 +44,9 @@ ansible-galaxy collection install cisco.dnac:3.3.1
```

## Requirements
- Ansible >= 2.9
- [Python DNA Center SDK](https://github.com/cisco-en-programmability/dnacentersdk) v2.4.7 or newer
- Python >= 3.6, as the DNA Center SDK doesn't support Python version 2.x
- Ansible >= 2.15
- [Python DNA Center SDK](https://github.com/cisco-en-programmability/dnacentersdk) v2.6.0 or newer
- Python >= 3.9, as the DNA Center SDK doesn't support Python version 2.x

## Install
Ansible must be installed ([Install guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html))
Expand Down
8 changes: 8 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -858,3 +858,11 @@ releases:
- Added a method to validate IP addresses.
- Fixed a minor issue in the site workflow manager module.
- Updating galaxy.yml ansible.utils dependencies.
6.13.3:
release_date: "2024-04-08"
changes:
release_summary: Enhancements in discovery, template, swim and inventory workflow manager modules.
minor_changes:
- Adding support to importing a template using JSON file
- Changes in discovery workflow manager modules relating to different states of the discovery job
- Changes in inventory and swim workflow manager modules.
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: dnac
version: 6.13.2
version: 6.13.3
readme: README.md
authors:
- Rafael Campos <rcampos@altus.cr>
Expand Down
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
requires_ansible: '>=2.14.0'
requires_ansible: '>=2.15.0'
20 changes: 1 addition & 19 deletions playbooks/device_details.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,7 @@ template_details:
import_template:
do_version: false
project_name: 'Onboarding Configuration'
payload:
- name: 'Platinum-Onboarding-Template-J21'
device_types:
- product_family: 'Switches and Hubs'
productSeries: 'Cisco Catalyst 9300 Series Switches'
software_type: 'IOS'
language: 'JINJA'
- name: 'Platinum-Onboarding-Template-J22'
device_types:
- product_family: 'Switches and Hubs'
productSeries: 'Cisco Catalyst 9300 Series Switches'
software_type: 'IOS'
language: 'JINJA'
- name: 'Platinum-Onboarding-Template-J23'
device_types:
- product_family: 'Switches and Hubs'
productSeries: 'Cisco Catalyst 9300 Series Switches'
software_type: 'IOS'
language: 'JINJA'
template_file: 'JSON template file'

device_details:
- site_name: 'Global/Chennai/Trill'
Expand Down
10 changes: 5 additions & 5 deletions playbooks/template_workflow_manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: true
dnac_log_level: "{{ dnac_debug }}"
dnac_log_append: true
dnac_log: True
dnac_log_level: DEBUG
dnac_log_append: True
dnac_log_file_path: "{{ dnac_log_file_path }}"
validate_response_schema: false
validate_response_schema: False
state: "merged"
config_verify: true
#ignore_errors: true #Enable this to continue execution even the task fails
Expand All @@ -41,7 +41,7 @@
template_name: AP_Onboarding
import:
project: "{{ item.import_project }}"
# template: "{{ item.import_template }}"
template: "{{ item.import_template }}"
register: template_result
with_items: '{{ template_details }}'
tags:
Expand Down
36 changes: 36 additions & 0 deletions plugins/module_utils/dnac.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,42 @@ def is_valid_ipv4(self, ip_address):
except socket.error:
return False

def is_path_exists(self, file_path):
"""
Check if the file path 'file_path' exists or not.
Parameters:
file_path (string) - Path of the provided file.
Returns:
True/False (bool) - True if the file path exists, else False.
"""

if not os.path.exists(file_path):
return False

return True

def is_json(self, file_path):
"""
Check if the file in the file path is JSON or not.
Parameters:
file_path (string) - Path of the provided file.
Returns:
True/False (bool) - True if the file is in JSON format, else False.
"""

try:
with open(file_path, 'r') as file:
json.load(file)
return True

except (ValueError, FileNotFoundError):
self.log("The provided file '{0}' is not in JSON format".format(file_path), "CRITICAL")
return False


def is_list_complex(x):
return isinstance(x[0], dict) or isinstance(x[0], list)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
- Task_id path parameter. Task id information of ap config.
type: str
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Wireless GetAccessPointConfigurationTaskResult
description: Complete reference of the GetAccessPointConfigurationTaskResult API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/app_policy_default_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyDefault
description: Complete reference of the GetApplicationPolicyDefault API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/app_policy_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
- PolicyScope query parameter. Policy scope name.
type: str
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicy
description: Complete reference of the GetApplicationPolicy API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/app_policy_intent_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@
type: dict
type: list
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy ApplicationPolicyIntent
description: Complete reference of the ApplicationPolicyIntent API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/app_policy_queuing_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
type: str
type: list
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy CreateApplicationPolicyQueuingProfile
description: Complete reference of the CreateApplicationPolicyQueuingProfile API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/app_policy_queuing_profile_count_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyQueuingProfileCount
description: Complete reference of the GetApplicationPolicyQueuingProfileCount API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/app_policy_queuing_profile_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
- Name query parameter. Queuing profile name.
type: str
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyQueuingProfile
description: Complete reference of the GetApplicationPolicyQueuingProfile API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/application_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
type: str
type: list
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy CreateApplicationSet
description: Complete reference of the CreateApplicationSet API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/application_sets_count_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationSetsCount
description: Complete reference of the GetApplicationSetsCount API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/application_sets_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
- Name query parameter.
type: str
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationSets
description: Complete reference of the GetApplicationSets API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
type: list
type: list
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy CreateApplication
description: Complete reference of the CreateApplication API.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/applications_count_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.5.5
- python >= 3.5
- dnacentersdk >= 2.6.0
- python >= 3.9
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationsCount
description: Complete reference of the GetApplicationsCount API.
Expand Down
Loading

0 comments on commit fa3ee16

Please sign in to comment.