• AnsibleFest
  • Products
  • Community
  • Webinars & Training
  • Blog
Ansible Logo
Documentation
Ansible
7

Ansible getting started

  • Getting started with Ansible

Installation, Upgrade & Configuration

  • Installation Guide
  • Ansible Porting Guides

Using Ansible

  • Building Ansible inventories
  • Using Ansible command line tools
  • Using Ansible playbooks
  • Protecting sensitive data with Ansible vault
  • Using Ansible modules and plugins
  • Using Ansible collections
  • Using Ansible on Windows and BSD
  • Ansible tips and tricks

Contributing to Ansible

  • Ansible Community Guide
  • Ansible Collections Contributor Guide
  • ansible-core Contributors Guide
  • Advanced Contributor Guide
  • Ansible documentation style guide

Extending Ansible

  • Developer Guide

Common Ansible Scenarios

  • Legacy Public Cloud Guides
  • Network Technology Guides
  • Virtualization and Containerization Guides

Network Automation

  • Network Getting Started
  • Network Advanced Topics
  • Network Developer Guide

Ansible Galaxy

  • Galaxy User Guide
  • Galaxy Developer Guide

Reference & Appendices

  • Collection Index
    • Collections in the Amazon Namespace
    • Collections in the Ansible Namespace
    • Collections in the Arista Namespace
    • Collections in the Awx Namespace
    • Collections in the Azure Namespace
    • Collections in the Check_point Namespace
    • Collections in the Chocolatey Namespace
    • Collections in the Cisco Namespace
      • Cisco.Aci
      • Cisco.Asa
      • Cisco.Dnac
        • Description
        • Plugin Index
      • Cisco.Intersight
      • Cisco.Ios
      • Cisco.Iosxr
      • Cisco.Ise
      • Cisco.Meraki
      • Cisco.Mso
      • Cisco.Nso
      • Cisco.Nxos
      • Cisco.Ucs
    • Collections in the Cloud Namespace
    • Collections in the Cloudscale_ch Namespace
    • Collections in the Community Namespace
    • Collections in the Containers Namespace
    • Collections in the Cyberark Namespace
    • Collections in the Dellemc Namespace
    • Collections in the F5networks Namespace
    • Collections in the Fortinet Namespace
    • Collections in the Frr Namespace
    • Collections in the Gluster Namespace
    • Collections in the Google Namespace
    • Collections in the Grafana Namespace
    • Collections in the Hetzner Namespace
    • Collections in the Hpe Namespace
    • Collections in the Ibm Namespace
    • Collections in the Infinidat Namespace
    • Collections in the Infoblox Namespace
    • Collections in the Inspur Namespace
    • Collections in the Junipernetworks Namespace
    • Collections in the Kubernetes Namespace
    • Collections in the Lowlydba Namespace
    • Collections in the Mellanox Namespace
    • Collections in the Netapp Namespace
    • Collections in the Netapp_eseries Namespace
    • Collections in the Netbox Namespace
    • Collections in the Ngine_io Namespace
    • Collections in the Openstack Namespace
    • Collections in the Openvswitch Namespace
    • Collections in the Ovirt Namespace
    • Collections in the Purestorage Namespace
    • Collections in the Sensu Namespace
    • Collections in the Splunk Namespace
    • Collections in the T_systems_mms Namespace
    • Collections in the Theforeman Namespace
    • Collections in the Vmware Namespace
    • Collections in the Vultr Namespace
    • Collections in the Vyos Namespace
    • Collections in the Wti Namespace
  • Indexes of all modules and plugins
  • Playbook Keywords
  • Return Values
  • Ansible Configuration Settings
  • Controlling how Ansible behaves: precedence rules
  • YAML Syntax
  • Python 3 Support
  • Interpreter Discovery
  • Releases and maintenance
  • Testing Strategies
  • Sanity Tests
  • Frequently Asked Questions
  • Glossary
  • Ansible Reference: Module Utilities
  • Special Variables
  • Red Hat Ansible Automation Platform
  • Ansible Automation Hub
  • Logging Ansible output

Roadmaps

  • Ansible Roadmap
  • ansible-core Roadmaps




Ansible
  • Collection Index
  • Collections in the Cisco Namespace
  • Cisco.Dnac
  • cisco.dnac.swim_intent module – Intent module for SWIM related functions


cisco.dnac.swim_intent module – Intent module for SWIM related functions

Note

This module is part of the cisco.dnac collection (version 6.6.4).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cisco.dnac. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cisco.dnac.swim_intent.

New in cisco.dnac 6.6.0

  • Synopsis

  • Requirements

  • Parameters

  • Notes

  • Examples

  • Return Values

Synopsis

  • Manage operation related to image importation, distribution, activation and tagging image as golden

  • API to fetch a software image from remote file system using URL for HTTP/FTP and upload it to DNA Center. Supported image files extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2.

  • API to fetch a software image from local file system and upload it to DNA Center Supported image files extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2.

  • API to tag/untag image as golen for a given family of devices

  • API to distribute a software image on a given device. Software image must be imported successfully into DNA Center before it can be distributed.

  • API to activate a software image on a given device. Software image must be present in the device flash.

Requirements

The below requirements are needed on the host that executes this module.

  • dnacentersdk == 2.4.5

  • python >= 3.5

Parameters

Parameter

Comments

config

list / elements=dictionary / required

List of details of SWIM image being managed

imageActivationDetails

dictionary

Details for SWIM image activation. Device on which the image needs to activated can be speciifed using any of the following parameters - deviceSerialNumber, deviceIPAddress, deviceHostname or deviceMacAddress.

activateLowerImageVersion

boolean

ActivateLowerImageVersion flag.

Choices:

  • false

  • true

deviceHostname

string

Device hostname where the image needs to be activated

deviceIPAddress

string

Device IP address where the image needs to be activated

deviceMacAddress

string

Device MAC address where the image needs to be activated

deviceSerialNumber

string

Device serial number where the image needs to be activated

deviceUpgradeMode

string

Swim Trigger Activation’s deviceUpgradeMode.

distributeIfNeeded

boolean

DistributeIfNeeded flag.

Choices:

  • false

  • true

imageName

string

SWIM image’s name

scheduleValidate

boolean

ScheduleValidate query parameter. ScheduleValidate, validates data before schedule (Optional).

Choices:

  • false

  • true

imageDistributionDetails

dictionary

Details for SWIM image distribution. Device on which the image needs to distributed can be speciifed using any of the following parameters - deviceSerialNumber, deviceIPAddress, deviceHostname or deviceMacAddress.

deviceHostname

string

Device hostname where the image needs to be distributed

deviceIPAddress

string

Device IP address where the image needs to be distributed

deviceMacAddress

string

Device MAC address where the image needs to be distributed

deviceSerialNumber

string

Device serial number where the image needs to be distributed

imageName

string

SWIM image’s name

importImageDetails

dictionary

Details of image being imported

localImageDetails

dictionary

Details of the local path of the image to be imported.

filePath

string

File absolute path.

isThirdParty

boolean

IsThirdParty query parameter. Third party Image check.

Choices:

  • false

  • true

thirdPartyApplicationType

string

ThirdPartyApplicationType query parameter. Third Party Application Type.

thirdPartyImageFamily

string

ThirdPartyImageFamily query parameter. Third Party image family.

thirdPartyVendor

string

ThirdPartyVendor query parameter. Third Party Vendor.

type

string

The source of import, supports url import or local import.

urlDetails

dictionary

URL details for SWIM import

payload

list / elements=dictionary

Swim Import Via Url’s payload.

applicationType

string

Swim Import Via Url’s applicationType.

imageFamily

string

Swim Import Via Url’s imageFamily.

sourceURL

string

Swim Import Via Url’s sourceURL.

thirdParty

boolean

ThirdParty flag.

Choices:

  • false

  • true

vendor

string

Swim Import Via Url’s vendor.

scheduleAt

string

ScheduleAt query parameter. Epoch Time (The number of milli-seconds since January 1 1970 UTC) at which the distribution should be scheduled (Optional).

scheduleDesc

string

ScheduleDesc query parameter. Custom Description (Optional).

scheduleOrigin

string

ScheduleOrigin query parameter. Originator of this call (Optional).

taggingDetails

dictionary

Details for tagging or untagging an image as golden

deviceFamilyName

string

Device family name

deviceRole

string

Device Role. Permissible Values ALL, UNKNOWN, ACCESS, BORDER ROUTER, DISTRIBUTION and CORE.

imageName

string

SWIM image name which will be tagged or untagged as golden.

siteName

string

Site name for which SWIM image will be tagged/untagged as golden. If not provided, SWIM image will be mapped to global site.

tagging

boolean

Booelan value to tag/untag SWIM image as golden If True then the given image will be tagged as golden. If False then the given image will be un-tagged as golden.

Choices:

  • false

  • true

dnac_debug

boolean

Flag for Cisco DNA Center SDK to enable debugging.

Choices:

  • false ← (default)

  • true

dnac_host

string / required

The Cisco DNA Center hostname.

dnac_log

boolean

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

Choices:

  • false ← (default)

  • true

dnac_password

string

The Cisco DNA Center password to authenticate.

dnac_port

string

The Cisco DNA Center port.

Default: "443"

dnac_username

aliases: user

string

The Cisco DNA Center username to authenticate.

Default: "admin"

dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

  • false

  • true ← (default)

dnac_version

string

Informs the SDK which version of Cisco DNA Center to use.

Default: "2.2.3.3"

validate_response_schema

boolean

Flag for Cisco DNA Center SDK to enable the validation of request bodies against a JSON schema.

Choices:

  • false

  • true ← (default)

Notes

Note

  • SDK Method used are software_image_management_swim.SoftwareImageManagementSwim.import_software_image_via_url, software_image_management_swim.SoftwareImageManagementSwim.tag_as_golden_image, software_image_management_swim.SoftwareImageManagementSwim.trigger_software_image_distribution, software_image_management_swim.SoftwareImageManagementSwim.trigger_software_image_activation,

  • Paths used are post /dna/intent/api/v1/image/importation/source/url, post /dna/intent/api/v1/image/importation/golden, post /dna/intent/api/v1/image/distribution, post /dna/intent/api/v1/image/activation/device,

  • Does not support 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

Examples

- name: Import an image from a URL, tag it as golden and load it on device
  cisco.dnac.swim_intent:
    dnac_host: "{{dnac_host}}"
    dnac_username: "{{dnac_username}}"
    dnac_password: "{{dnac_password}}"
    dnac_verify: "{{dnac_verify}}"
    dnac_port: "{{dnac_port}}"
    dnac_version: "{{dnac_version}}"
    dnac_debug: "{{dnac_debug}}"
    dnac_log: True
    config:
    - importImageDetails:
        type: string
        urlDetails:
          payload:
          - sourceURL: string
            isThirdParty: bool
            imageFamily: string
            vendor: string
            applicationType: string
          scheduleAt: string
          scheduleDesc: string
          scheduleOrigin: string
      taggingDetails:
        imageName: string
        deviceRole: string
        deviceFamilyName: string
        siteName: string
        tagging: bool
      imageDistributionDetails:
        imageName: string
        deviceSerialNumber: string
      imageActivationDetails:
        scheduleValidate: bool
        activateLowerImageVersion: bool
        distributeIfNeeded: bool
        deviceSerialNumber: string
        imageName: string

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

response

dictionary

A dictionary with activation details as returned by the DNAC Python SDK

Returned: always

Sample: "{\n  \"response\": {\n                    \"additionalStatusURL\": String,\n                    \"data\": String,\n                    \"endTime\": 0,\n                    \"id\": String,\n                    \"instanceTenantId\": String,\n                    \"isError\": bool,\n                    \"lastUpdate\": 0,\n                    \"progress\": String,\n                    \"rootId\": String,\n                    \"serviceType\": String,\n                    \"startTime\": 0,\n                    \"version\": 0\n              },\n  \"msg\": String\n}\n"

Authors

  • Madhan Sankaranarayanan (@madhansansel) Rishita Chowdhary (@rishitachowdhary)

Collection links

Issue Tracker Repository (Sources)

Previous Next

© Copyright Ansible project contributors. Last updated on Mar 30, 2023.