cisco.ucs.ucs_org 模块 – 管理 UCS Manager 的 UCS 组织

注意

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

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

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

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

概要

  • 管理 UCS Manager 的 UCS 组织。

要求

以下是执行此模块的主机所需的条件。

  • ucsmsdk

参数

参数

注释

delegate_to

字符串

模块将在哪里运行

默认值: "localhost"

description

别名:descr

字符串

组织的用户定义描述。

最多输入 256 个字符。

您可以使用除以下字符之外的任何字符或空格

`(重音符)、\(反斜杠)、^(插入符)、”(双引号)、=(等号)、>(大于)、<(小于)或‘(单引号)。

hostname

字符串 / 必需

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

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

org_name

别名:name

字符串

组织的名称。

最多输入 16 个字符。

您可以使用除以下字符之外的任何字符或空格

`(重音符)、\(反斜杠)、^(插入符)、”(双引号)、=(等号)、>(大于)、<(小于)或‘(单引号)。

parent_org_path

字符串

从根组织到要添加或更新的组织的父组织的分隔符为正斜杠 / 的分层路径。

UCS Manager 支持最多五层深度(不包括根组织)的分层组织结构。

例如,名为 level5 的组织的 parent_org_path 可以是 root/level1/level2/level3/level4

默认值: "root"

password

字符串 / 必需

Cisco UCS Manager 身份验证的密码。

port

整数

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

proxy

字符串

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

state

字符串

如果为 absent,则将删除组织。

如果为 present,则将创建或更新组织。

选项

  • "absent"

  • "present" ← (默认)

use_proxy

布尔值

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

选项

  • false

  • true ← (默认)

use_ssl

布尔值

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

选项

  • false

  • true ← (默认)

username

字符串

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

默认值: "admin"

示例

- name: Add UCS Organization
  cisco.ucs.ucs_org:
    hostname: "{{ ucs_hostname }}"
    username: "{{ ucs_username }}"
    password: "{{ ucs_password }}"
    org_name: test
    description: testing org
    state: present
    delegate_to: localhost

- name: Update UCS Organization
  cisco.ucs.ucs_org:
    hostname: "{{ ucs_hostname }}"
    username: "{{ ucs_username }}"
    password: "{{ ucs_password }}"
    org_name: test
    description: Testing org
    state: present
    delegate_to: localhost

- name: Add UCS Organization
  cisco.ucs.ucs_org:
    hostname: "{{ ucs_hostname }}"
    username: "{{ ucs_username }}"
    password: "{{ ucs_password }}"
    org_name: level1
    parent_org_path: root
    description: level1 org
    state: present
    delegate_to: localhost

- name: Add UCS Organization
  cisco.ucs.ucs_org:
    hostname: "{{ ucs_hostname }}"
    username: "{{ ucs_username }}"
    password: "{{ ucs_password }}"
    org_name: level2
    parent_org_path: root/level1
    description: level2 org
    state: present

- name: Add UCS Organization
  cisco.ucs.ucs_org:
    hostname: "{{ ucs_hostname }}"
    username: "{{ ucs_username }}"
    password: "{{ ucs_password }}"
    org_name: level3
    parent_org_path: root/level1/level2
    description: level3 org
    state: present

- name: Remove UCS Organization
  cisco.ucs.ucs_org:
    hostname: "{{ ucs_hostname }}"
    username: "{{ ucs_username }}"
    password: "{{ ucs_password }}"
    org_name: level2
    parent_org_path: root/level1
    state: absent

作者

  • David Soper (@dsoper2)

  • John McDonough (@movinalot)

  • CiscoUcs (@CiscoUcs)