cisco.dnac.site_intent module – Resource module for Site operations
Note
This module is part of the cisco.dnac collection (version 6.10.4).
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.site_intent
.
New in cisco.dnac 6.6.0
Synopsis
Manage operation create, update and delete of the resource Sites.
Creates site with area/building/floor with specified hierarchy.
Updates site with area/building/floor with specified hierarchy.
Deletes site with area/building/floor with specified hierarchy.
Requirements
The below requirements are needed on the host that executes this module.
dnacentersdk == 2.4.5
python >= 3.5
Parameters
Parameter |
Comments |
---|---|
List of details of site being managed. |
|
Site Details. |
|
Site Create’s area. |
|
Name of the area (eg Area1). |
|
Complete Parent name of the Area to be created/deleted(eg Global/). |
|
Building Details. |
|
Address of the building to be created. |
|
Latitude coordinate of the building (eg 37.338).Values between -90 to +90. |
|
Longitude coordinate of the building (eg -121.832).Values between -180 to +180. |
|
Name of the building (eg building1). |
|
Complete Parent name of the Building to be created/deleted(eg Global/USA/San Francisco). |
|
Site Create’s floor. |
|
Floor number in the building/site (eg 5).once created, it can’t be modified. |
|
Height of the floor units is ft. (eg 15). |
|
Length of the floor units is ft. (eg 100). |
|
Name of the floor (eg floor-1). |
|
Complete Parent name of the floor to be created(eg Global/USA/San Francisco/BGL_18). |
|
Type of floor. Allowed values are ‘Cubes And Walled Offices’, ‘Drywall Office Only’, ‘Indoor High Ceiling’, ‘Outdoor Open Space’. |
|
Width of the floor units is ft. (eg 100). |
|
Type of site to create/update/delete (eg area, building, floor). |
|
Set to True to verify the Cisco Catalyst Center config after applying the playbook config. Choices: |
|
Flag for Cisco DNA Center SDK to enable debugging. Choices: |
|
The Cisco DNA Center hostname. |
|
Flag to enable/disable playbook execution logging. When true and dnac_log_file_path is provided, - Create the log file at the execution location with the specified name. When true and dnac_log_file_path is not provided, - Create the log file at the execution location with the name ‘dnac.log’. When false, - Logging is disabled. If the log file doesn’t exist, - It is created in append or write mode based on the “dnac_log_append” flag. If the log file exists, - It is overwritten or appended based on the “dnac_log_append” flag. Choices: |
|
Determines the mode of the file. Set to True for ‘append’ mode. Set to False for ‘write’ mode. Choices: |
|
Governs logging. Logs are recorded if dnac_log is True. If path is not specified, - When ‘dnac_log_append’ is True, ‘dnac.log’ is generated in the current Ansible directory; logs are appended. - When ‘dnac_log_append’ is False, ‘dnac.log’ is generated; logs are overwritten. If path is specified, - When ‘dnac_log_append’ is True, the file opens in append mode. - When ‘dnac_log_append’ is False, the file opens in write (w) mode. - In shared file scenarios, without append mode, content is overwritten after each module execution. - For a shared log file, set append to False for the 1st module (to overwrite); for subsequent modules, set append to True. Default: :ansible-option-default:`"dnac.log"` |
|
Sets the threshold for log level. Messages with a level equal to or higher than this will be logged. Levels are listed in order of severity [CRITICAL, ERROR, WARNING, INFO, DEBUG]. CRITICAL indicates serious errors halting the program. Displays only CRITICAL messages. ERROR indicates problems preventing a function. Displays ERROR and CRITICAL messages. WARNING indicates potential future issues. Displays WARNING, ERROR, CRITICAL messages. INFO tracks normal operation. Displays INFO, WARNING, ERROR, CRITICAL messages. DEBUG provides detailed diagnostic info. Displays all log messages. Default: :ansible-option-default:`"WARNING"` |
|
The Cisco DNA Center password to authenticate. |
|
The Cisco DNA Center port. Default: :ansible-option-default:`"443"` |
|
The Cisco DNA Center username to authenticate. Default: :ansible-option-default:`"admin"` |
|
Flag to enable or disable SSL certificate verification. Choices: |
|
Informs the SDK which version of Cisco DNA Center to use. Default: :ansible-option-default:`"2.2.3.3"` |
|
The state of Catalyst Center after module completion. Choices: |
|
Flag for Cisco DNA Center SDK to enable the validation of request bodies against a JSON schema. Choices: |
Notes
Note
SDK Method used are sites.Sites.create_site, sites.Sites.update_site, sites.Sites.delete_site
Paths used are post /dna/intent/api/v1/site, put dna/intent/api/v1/site/{siteId}, delete dna/intent/api/v1/site/{siteId}
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: Create a new area site
cisco.dnac.site_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_level: "{{dnac_log_level}}"
dnac_log: "{{dnac_log}}"
state: merged
config:
- site:
area:
name: string
parentName: string
type: string
- name: Create a new building site
cisco.dnac.site_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_level: "{{dnac_log_level}}"
dnac_log: "{{dnac_log}}"
state: merged
config:
- site:
building:
address: string
latitude: 0
longitude: 0
name: string
parentName: string
type: string
- name: Create a Floor site under the building
cisco.dnac.site_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_level: "{{dnac_log_level}}"
dnac_log: "{{dnac_log}}"
state: merged
config:
- site:
floor:
name: string
parent_name: string
length: int
width: int
height: int
rf_model: string
floor_number: int
type: string
- name: Updating the Floor details under the building
cisco.dnac.site_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_level: "{{dnac_log_level}}"
dnac_log: "{{dnac_log}}"
state: merged
config:
- site:
floor:
name: string
parent_name: string
length: int
width: int
height: int
type: string
- name: Deleting any site you need site name and parentName
cisco.dnac.site_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_level: "{{dnac_log_level}}"
dnac_log: "{{dnac_log}}"
state: deleted
config:
- site:
floor:
name: string
parent_name: string
type: string
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A dictionary with API execution details as returned by the Cisco Catalyst Center Python SDK Returned: always |
|
A dictionary with existing site details. Returned: always |
|
A dictionary with API execution details as returned by the Cisco Catalyst Center Python SDK Returned: always |
|
A list with the response returned by the Cisco Catalyst Center Python Returned: always Sample: :ansible-rv-sample-value:`["{\\n \\"response\\": []", "\\n \\"msg\\": String\\n}\\n"]` |