cisco.ucs.ucs_managed_objects module – Configures Managed Objects on Cisco UCS Manager
Note
This module is part of the cisco.ucs collection (version 1.8.0).
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.ucs
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: cisco.ucs.ucs_managed_objects
.
New in cisco.ucs 2.8
Synopsis
Configures Managed Objects on Cisco UCS Manager.
The Python SDK module, Python class within the module (UCSM Class), and all properties must be directly specified.
More information on the UCSM Python SDK and how to directly configure Managed Objects is available at UCSM Python SDK.
Requirements
The below requirements are needed on the host that executes this module.
ucsmsdk
Parameters
Parameter |
Comments |
---|---|
IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator https://cs.co/ucspe |
|
List of managed objects to configure. Each managed object has suboptions the specify the Python SDK module, class, and properties to configure. |
|
Optional list of child objects. Each child has its own module, class, and properties suboptions. The parent_mo_or_dn property for child objects is automatically set as the list of children is configured. |
|
Name of the Python class that will be used to configure the Managed Object. |
|
Name of the Python SDK module implementing the required class. |
|
List of properties to configure on the Managed Object. See the UCSM Python SDK for information on properties for each class. |
|
Password for Cisco UCS Manager authentication. |
|
Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
|
If use_proxy is no, specfies proxy to be used for connection. e.g. ‘http://proxy.xy.z:8080’ |
|
If If Choices:
|
|
If Choices:
|
|
If Choices:
|
|
Username for Cisco UCS Manager authentication. Default: |
Examples
- name: Configure Network Control Policy
cisco.ucs.ucs_managed_objects:
hostname: 172.16.143.150
username: admin
password: password
objects:
- module: ucsmsdk.mometa.nwctrl.NwctrlDefinition
class: NwctrlDefinition
properties:
parent_mo_or_dn: org-root
cdp: enabled
descr: ''
lldp_receive: enabled
lldp_transmit: enabled
name: Enable-CDP-LLDP
- name: Remove Network Control Policy
cisco.ucs.ucs_managed_objects:
hostname: 172.16.143.150
username: admin
password: password
objects:
- module: ucsmsdk.mometa.nwctrl.NwctrlDefinition
class: NwctrlDefinition
properties:
parent_mo_or_dn: org-root
name: Enable-CDP-LLDP
state: absent
- name: Configure Boot Policy Using JSON objects list with children
cisco.ucs.ucs_managed_objects:
hostname: 172.16.143.150
username: admin
password: password
objects:
- {
"module": "ucsmsdk.mometa.lsboot.LsbootPolicy",
"class": "LsbootPolicy",
"properties": {
"parent_mo_or_dn": "org-root",
"name": "Python_SDS",
"enforce_vnic_name": "yes",
"boot_mode": "legacy",
"reboot_on_update": "no"
},
"children": [
{
"module": "ucsmsdk.mometa.lsboot.LsbootVirtualMedia",
"class": "LsbootVirtualMedia",
"properties": {
"access": "read-only-local",
"lun_id": "0",
"order": "2"
}
},
{
"module": "ucsmsdk.mometa.lsboot.LsbootStorage",
"class": "LsbootStorage",
"properties": {
"order": "1"
},
"children": [
{
"module": "ucsmsdk.mometa.lsboot.LsbootLocalStorage",
"class": "LsbootLocalStorage",
"properties": {},
"children": [
{
"module": "ucsmsdk.mometa.lsboot.LsbootDefaultLocalImage",
"class": "LsbootDefaultLocalImage",
"properties": {
"order": "1"
}
}
]
}
]
}
]
}
- name: Remove Boot Policy Using JSON objects list
cisco.ucs.ucs_managed_objects:
hostname: 172.16.143.150
username: admin
password: password
objects:
- {
"module": "ucsmsdk.mometa.lsboot.LsbootPolicy",
"class": "LsbootPolicy",
"properties": {
"parent_mo_or_dn": "org-root",
"name": "Python_SDS"
}
}
state: absent