cisco.mso.mso_schema_template_anp_epg_useg_attribute 模块 – 管理模式模板中的 EPG uSeg 属性

注意

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

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

要安装它,请使用:ansible-galaxy collection install cisco.mso。您需要进一步的要求才能使用此模块,请参阅 要求 了解详细信息。

要在 playbook 中使用它,请指定:cisco.mso.mso_schema_template_anp_epg_useg_attribute

概要

  • 在 Cisco ACI 多站点上管理模式模板 EPG 中的 uSeg 属性。

要求

以下是在执行此模块的主机上需要的。

  • 多站点 Orchestrator v2.1 或更高版本

参数

参数

注释

anp

字符串 / 必需

应用程序配置文件的名称。

描述

别名: descr

字符串

uSeg 属性的描述。

epg

字符串 / 必需

EPG 的名称。

主机

别名: hostname

字符串

ACI 多站点 Orchestrator 主机的 IP 地址或主机名。

如果未在任务中指定该值,则将使用环境变量 MSO_HOST 的值。

login_domain

字符串

用于身份验证的登录域名。

默认值为 Local。

如果未在任务中指定该值,则将使用环境变量 MSO_LOGIN_DOMAIN 的值。

当使用 HTTPAPI 连接插件时,如果未指定此属性,则将使用清单变量 ansible_httpapi_login_domain

名称

别名: useg

字符串

uSeg 属性的名称和显示名称。

operator

字符串

uSeg 属性的运算符类型。

选项

  • "等于"

  • "包含"

  • "以开头"

  • "以结尾"

output_level

字符串

影响此 MSO 模块的输出。

normal 表示标准输出,包括 current 字典

info 添加信息性输出,包括 previousproposedsent 字典

debug 添加调试输出,包括 filter_stringmethodresponsestatusurl 信息

如果未在任务中指定该值,则将使用环境变量 MSO_OUTPUT_LEVEL 的值。

选项

  • "debug"

  • "info"

  • "normal" ← (默认)

password

字符串

用于身份验证的密码。

如果未在任务中指定该值,则将使用环境变量 MSO_PASSWORDANSIBLE_NET_PASSWORD 的值。

port

整数

用于 REST 连接的端口号。

默认值取决于参数 `use_ssl`。

如果未在任务中指定该值,则将使用环境变量 MSO_PORT 的值。

schema

字符串 / 必需

模式的名称。

state

字符串

使用 presentabsent 进行添加或删除。

使用 query 列出单个对象或多个对象。

选项

  • "absent"

  • "present" ← (默认)

  • "query"

template

字符串 / 必需

模板的名称。

timeout

整数

套接字级别的超时时间,以秒为单位。

默认值为 30 秒。

如果任务中未指定该值,则将使用环境变量 MSO_TIMEOUT 的值。

type

别名: attribute_type

字符串

uSeg 属性的类型。

选项

  • "vm_name"

  • "ip"

  • "mac"

  • "vmm_domain"

  • "vm_operating_system"

  • "vm_tag"

  • "vm_hypervisor_identifier"

  • "dns"

  • "vm_datacenter"

  • "vm_identifier"

  • "vnic_dn"

use_proxy

布尔值

如果为 false,即使目标主机上的环境变量中定义了代理,也不会使用代理。

如果任务中未指定该值,则将使用环境变量 MSO_USE_PROXY 的值。

默认为 true

选项

  • false

  • true

use_ssl

布尔值

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

如果任务中未指定该值,则将使用环境变量 MSO_USE_SSL 的值。

当使用 HTTPAPI 连接插件时,如果未指定此属性,将使用 inventory 变量 ansible_httpapi_use_ssl

当使用 HTTPAPI 连接插件 (mso 或 nd) 时,默认为 false,当使用旧的连接方法(仅适用于 mso)时,默认为 true

选项

  • false

  • true

useg_subnet

布尔值

仅当 attribute_type 为 IP 时,才能使用 uSeg 子网。

使用 false 将自定义 uSeg 子网 IP 地址设置为 uSeg 属性。

使用 true 将默认 uSeg 子网 IP 地址设置为 0.0.0.0。

选项

  • false

  • true

username

字符串

用于身份验证的用户名。

如果任务中未指定该值,则将使用环境变量 MSO_USERNAMEANSIBLE_NET_USERNAME 的值。

validate_certs

布尔值

如果为 false,则不会验证 SSL 证书。

只有在个人控制的站点上使用自签名证书时,才应将其设置为 false

如果任务中未指定该值,则将使用环境变量 MSO_VALIDATE_CERTS 的值。

默认为 true

选项

  • false

  • true

value

别名: attribute_value

字符串

uSeg 属性的值。

Notes

注意

  • 由于 MSO REST API 的限制,并发修改 EPG 子网可能很危险并导致数据损坏。

  • 此模块旨在支持 Multi Site Orchestrator v2.1 或更高版本。某些或所有功能可能无法在早期版本上工作。

Examples

- name: Add an uSeg attr with attribute_type - ip
  cisco.mso.mso_schema_template_anp_epg_useg_attribute:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema 1
    template: Template 1
    anp: ANP 1
    epg: EPG 1
    name: useg_attr_ip
    attribute_type: ip
    useg_subnet: false
    value: 10.0.0.0/24
    state: present

- name: Query a specific EPG uSeg attr with name
  cisco.mso.mso_schema_template_anp_epg_useg_attribute:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema 1
    template: Template 1
    anp: ANP 1
    epg: EPG 1
    name: useg_attr_ip
    state: query
  register: query_result

- name: Query all EPG uSeg attrs
  cisco.mso.mso_schema_template_anp_epg_useg_attribute:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema 1
    template: Template 1
    anp: ANP 1
    epg: EPG 1
    state: query
  register: query_result

- name: Remove a uSeg attr from an EPG with name
  cisco.mso.mso_schema_template_anp_epg_useg_attribute:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema 1
    template: Template 1
    anp: ANP 1
    epg: EPG 1
    name: useg_attr_ip
    state: absent

Authors

  • Sabari Jaganathan (@sajagana)