-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from cisco-en-programmability/develop
develop - collection version 6.6.0
- Loading branch information
Showing
29 changed files
with
5,541 additions
and
6 deletions.
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
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" |
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,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" |
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,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 |
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,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 |
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,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.
Oops, something went wrong.