Skip to content

Commit

Permalink
Merge pull request #77 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
develop - collection version 6.6.0
  • Loading branch information
wastorga authored Sep 13, 2022
2 parents 76d1dd4 + 4112779 commit b57dcfc
Show file tree
Hide file tree
Showing 29 changed files with 5,541 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Other versions of this collection have support for previous Cisco DNA Center ver
| 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.5.3 | 2.5.4 |
| 2.3.3.0 | 6.6.0 | 2.5.4 |

*Notes*:

Expand Down
11 changes: 10 additions & 1 deletion changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -591,4 +591,13 @@ releases:
bugfixes:
- Update dnacentersdk requirement from 2.5.0 to 2.5.4
- business_sda_hostonboarding_ssid_ippool - create function added.
- wireless_profile - create function fixed.
- wireless_profile - create function fixed.
6.6.0:
release_date: "2022-09-13"
changes:
release_summary: Added new intent modules
minor_changes:
- pnp_intent - new module.
- site_intent - new module.
- swim_intent - new module.
- template_intent - new module.
6 changes: 5 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---
namespace: cisco
name: dnac
version: 6.5.3
version: 6.6.0
readme: README.md
authors:
- Rafael Campos <rcampos@altus.cr>
- William Astorga <wastorga@altus.cr>
- Jose Bogarin <jbogarin@altus.cr>
- Bryan Vargas <bvargas@altus.cr>
- Francisco Muñoz <fmunoz@altus.cr>
- Madhan Sankaranarayanan (@madhansansel)
- Rishita Chowdhary (@rishitachowdhary)
description: Ansible Modules for Cisco DNA Center
license_file: "LICENSE"
tags:
Expand Down
54 changes: 54 additions & 0 deletions playbooks/device_details.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
template_details:
- proj_name: "Onboarding Configuration"
device_config: "hostname cat9k-1\n"
language: "velocity"
family: "Switches and Hubs"
type: "IOS-XE"
variant: "XE"
temp_name: "temp_cat9k-1"
description: "Test Template 1"
- proj_name: "Onboarding Configuration"
device_config: "hostname cat9k-2\n"
language: "velocity"
family: "Switches and Hubs"
type: "IOS-XE"
variant: "XE"
temp_name: "temp_cat9k-2"
description: "Test Template 2"
- proj_name: "Onboarding Configuration"
device_config: "hostname cat9k-3\n"
language: "velocity"
family: "Switches and Hubs"
type: "IOS-XE"
variant: "XE"
temp_name: "temp_cat9k-3"
description: "Test Template 3"

device_details:
- site_name: "Global/Chennai/Trill"
image_name: "cat9k_iosxe.17.04.01.SPA.bin"
proj_name: "Onboarding Configuration"
temp_name: "temp_cat9k-1"
device_version: "2"
device_number: "AB2425L8M7"
device_name: "Cat9k-1"
device_state: "Unclaimed"
device_id: "C9300-25UX"
- site_name: "Global/Chennai/Trill"
image_name: "cat9k_iosxe.17.04.01.SPA.bin"
proj_name: "Onboarding Configuration"
temp_name: "temp_cat9k-2"
device_version: "2"
device_number: "CD2425L8M7"
device_name: "Cat9k-2"
device_state: "Unclaimed"
device_id: "C9300-25UX"
- site_name: "Global/Chennai/Trill"
image_name: "cat9k_iosxe.17.04.01.SPA.bin"
proj_name: "Onboarding Configuration"
temp_name: "temp_cat9k-3"
device_version: "2"
device_number: "EF2425L8M7"
device_name: "Cat9k-3"
device_state: "Unclaimed"
device_id: "C9300-25UX"
11 changes: 11 additions & 0 deletions playbooks/image_details.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
image_details:
- import_type: "url"
url_source: "http://10.104.118.10/swim/17.9/cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin"
device_role: "ALL"
device_family_name: "Cisco Catalyst 9606R Switch-Cisco Catalyst 9600 Series Supervisor Engine 1"
device_serial_number: "FXS2325Q01C"
- import_type: "url"
url_source: "http://10.104.118.10/swim/17.9/cat9k_iosxe.BLD_V179_THROTTLE_LATEST_20220429_033422.SSA.bin"
device_role: "ALL"
device_family_name: "Cisco Catalyst 9606R Switch-Cisco Catalyst 9600 Series Supervisor Engine 1"
device_serial_number: "FXS5632Q01C"
61 changes: 61 additions & 0 deletions playbooks/template_pnp_intent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
- hosts: dnac_servers
vars_files:
- credentials.yml
- device_details.yml
gather_facts: no
connection: local
tasks:
#
# Project Info Section
#
- name: Test project template
cisco.dnac.template_intent:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
state: "merged"
#ignore_errors: true #Enable this to continue execution even the task fails
config:
- projectName: "{{ item.proj_name }}"
templateContent: "{{ item.device_config }}"
language: "{{ item.language }}"
deviceTypes:
- productFamily: "{{ item.family }}"
softwareType: "{{ item.type }}"
softwareVariant: "{{ item.variant }}"
templateName: "{{ item.temp_name }}"
versionDescription: "{{ item.description }}"
register: template_result
with_items: '{{ template_details }}'
tags:
- template


- name: Create pnp
cisco.dnac.pnp_intent:
dnac_host: "{{dnac_host}}"
dnac_username: "{{dnac_username}}"
dnac_password: "{{dnac_password}}"
dnac_verify: "{{dnac_verify}}"
dnac_port: "{{dnac_port}}"
dnac_debug: "{{dnac_debug}}"
dnac_log: True
config:
- site_name: "{{ item.site_name }}"
project_name: "{{ item.proj_name }}"
template_name: "{{ item.temp_name }}"
image_name: "{{ item.image_name }}"
device_version: "{{ item.device_version }}"
deviceInfo:
serialNumber: "{{ item.device_number }}"
hostname: "{{ item.device_name}}"
state: "{{ item.device_state }}"
pid: "{{ item.device_id }}"
register: pnp_result
with_items: '{{ device_details }}'
tags:
- pnp
41 changes: 41 additions & 0 deletions playbooks/test_swim_module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
- hosts: dnac_servers
vars_files:
- credentials_245.yml
- image_details.yml #Contains image and device details
gather_facts: no
connection: local
tasks:
#
# Project Info Section
#

- name: Import an image, tag it as golden and load it on device
cisco.dnac.swim_intent:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
config:
- importImageDetails:
type: "{{ item.import_type }}"
urlDetails:
payload:
- sourceURL: "{{ item.url_source }}"
isThirdParty: false
taggingDetails:
deviceRole: "{{ item.device_role }}"
deviceFamilyName: "{{ item.device_family_name }}"
tagging: true
imageDistributionDetails:
deviceSerialNumber: "{{ item.device_serial_number }}"
imageActivationDetails:
scehduleValidate: false
activateLowerImageVersion: true
deviceSerialNumber: "{{ item.device_serial_number }}"
distributeIfNeeded: true
with_items: '{{ image_details }}'
tags:
- swim
66 changes: 66 additions & 0 deletions plugins/doc_fragments/intent_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type


class ModuleDocFragment(object):

# Standard files documentation fragment
DOCUMENTATION = r'''
options:
dnac_host:
description:
- The Cisco DNA Center hostname.
type: str
required: true
dnac_port:
description:
- The Cisco DNA Center port.
type: str
default: '443'
dnac_username:
description:
- The Cisco DNA Center username to authenticate.
type: str
default: admin
aliases: [ user ]
dnac_password:
description:
- The Cisco DNA Center password to authenticate.
type: str
dnac_verify:
description:
- Flag to enable or disable SSL certificate verification.
type: bool
default: true
dnac_version:
description:
- Informs the SDK which version of Cisco DNA Center to use.
type: str
default: 2.2.3.3
dnac_debug:
description:
- Flag for Cisco DNA Center SDK to enable debugging.
type: bool
default: false
dnac_log:
description:
- Flag for logging playbook execution details.
If set to true the log file will be created at the location of the execution with the name dnac.log
type: bool
default: false
validate_response_schema:
description:
- Flag for Cisco DNA Center SDK to enable the validation of request bodies against a JSON schema.
type: bool
default: true
notes:
- "Does not support C(check_mode)"
- "The plugin runs on the control node and does not use any ansible connection plugins, but instead the embedded connection manager from Cisco DNAC SDK"
- "The parameters starting with dnac_ are used by the Cisco DNAC Python SDK to establish the connection"
'''
Empty file.
Loading

0 comments on commit b57dcfc

Please sign in to comment.