cisco.ucs.ucs_service_profile_from_template 模块 – 在 Cisco UCS Manager 上从模板配置服务配置文件

注意

此模块是 cisco.ucs 集合(版本 1.14.0)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install cisco.ucs。您需要满足其他要求才能使用此模块,请参阅 要求 以了解详细信息。

要在 playbook 中使用它,请指定:cisco.ucs.ucs_service_profile_from_template

概要

  • 配置在 Cisco UCS Manager 上从模板创建的服务配置文件。

要求

执行此模块的主机需要满足以下要求。

  • ucsmsdk

参数

参数

注释

description

字符串

可选

服务配置文件的描述

hostname

字符串 / 必需

Cisco UCS Manager 的 IP 地址或主机名。

模块可以与 UCS 平台模拟器一起使用 https://cs.co/ucspe

name

字符串 / 必需

服务配置文件的名称。

此名称可以是 2 到 32 个字母数字字符。

您不能使用空格或除 -(连字符)、“_”(下划线)、:(冒号)和 .(句点)之外的任何特殊字符。

此名称在同一组织内的所有服务配置文件和服务配置文件模板中必须是唯一的。

org_dn

字符串

组织 dn(可分辨名称)

默认值: "org-root"

password

字符串 / 必需

用于 Cisco UCS Manager 身份验证的密码。

port

整数

连接期间要使用的端口号(默认情况下,https 使用 443,http 连接使用 80)。

power_state

字符串

此服务配置文件与服务器关联时要应用的电源状态。

如果未提供值,则不会修改服务配置文件的 power_state。

选择

  • "up"

  • "down"

proxy

字符串

如果 use_proxy 为 no,则指定用于连接的代理。例如,'http://proxy.xy.z:8080'

source_template

字符串 / 必需

用于创建此服务配置文件的服务配置文件模板的名称。

state

字符串

如果为 present,将验证服务配置文件是否存在,如果需要,将创建服务配置文件。

如果为 absent,将验证服务配置文件是否不存在,如果需要,将删除服务配置文件。

选择

  • "present" ← (默认)

  • "absent"

use_proxy

布尔值

如果为 no,则不会使用系统环境变量定义的代理。

选择

  • false

  • true ← (默认)

use_ssl

布尔值

如果为 no,将使用 HTTP 连接而不是默认的 HTTPS 连接。

选择

  • false

  • true ← (默认)

user_label

字符串

要分配给此服务配置文件的用户标签。

username

字符串

用于 Cisco UCS Manager 身份验证的用户名。

默认值: "admin"

示例

- name: Configure Service Profile from Template
  cisco.ucs.ucs_service_profile_from_template:
    hostname: 172.16.143.150
    username: admin
    password: password
    name: test-sp-instance1
    source_template: test-sp
    discription: Created from Ansible

- name: Remove Service Profile
  cisco.ucs.ucs_service_profile_from_template:
    hostname: 172.16.143.150
    username: admin
    password: password
    name: test-sp-instance1
    state: absent

作者

  • David Soper (@dsoper2)

  • CiscoUcs (@CiscoUcs)