cisco.mso.mso_schema_site_service_graph 模块 – 在 Schema 站点中管理服务图

注意

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

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

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

要在剧本中使用它,请指定:cisco.mso.mso_schema_site_service_graph

概要

  • 管理 Cisco ACI 多站点上的 Schema 站点中的服务图。

  • 此模块仅在 MSO/NDO 版本 3.3 及更高版本中受支持。

要求

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

  • 多站点编排器 v2.1 或更高版本

参数

参数

注释

devices

列表 / 元素=字典

要与服务图关联的设备列表。

consumer_connector_type

字符串

Azure CNC 站点服务图的使用者连接器类型。

在创建期间未设置时默认为 none

选项

  • "none"

  • "redirect"

consumer_interface

字符串

Azure CNC L4-L7 设备的使用者接口名称。

device_name

别名:name

字符串 / 必需

设备的名称

provider_connector_type

字符串

Azure CNC 站点服务图的提供商连接器类型。

在创建期间未设置时默认为 none

选项

  • "none"

  • "redirect"

  • "source_nat"

  • "destination_nat"

  • "source_and_destination_nat"

provider_interface

字符串

Azure CNC L4-L7 设备的提供商接口名称。

host

别名:hostname

字符串

ACI 多站点编排器主机的 IP 地址或主机名。

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

login_domain

字符串

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

默认值为 Local。

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

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

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

字符串 / 必需

Schema 的名称。

service_graph

别名:name

字符串

要管理的服务图的名称。

site

字符串 / 必需

站点的名称。

state

字符串

使用 presentabsent 来添加或删除。

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

选项

  • "absent"

  • "present" ← (默认)

  • "query"

template

字符串 / 必需

模板的名称。

tenant

字符串

租户的名称。

timeout

整数

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

默认值为 30 秒。

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

use_proxy

布尔值

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

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

默认为 true

选项

  • false

  • true

use_ssl

布尔值

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

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

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

使用 HTTP API 连接插件 (mso 或 nd) 时,默认为 false;使用旧版连接方法 (仅限 mso) 时,默认为 true

选项

  • false

  • true

用户名

字符串

用于身份验证的用户名。

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

验证证书

布尔值

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

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

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

默认为 true

选项

  • false

  • true

注释

注意

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

示例

- name: Add a Service Graph
  cisco.mso.mso_schema_site_service_graph_node:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema1
    template: Template1
    service_graph: SG1
    site: site1
    tenant: tenant1
    devices:
      - name: ansible_test_firewall
      - name: ansible_test_adc
      - name: ansible_test_other
    state: present

- name: Add a Site service graph for the Azure cloud CNC
  cisco.mso.mso_schema_site_service_graph:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema1
    template: Template1
    service_graph: SG1
    site: site1
    tenant: tenant1
    devices:
      - name: ans_tnt_firewall1
        provider_connector_type: source_nat
        provider_interface: TP_FW_Inf1
        consumer_connector_type: redirect
        consumer_interface: TP_FW_Inf1
      - name: ans_tnt_app_lb
      - name: ans_tnt_other
        provider_connector_type: destination_nat
        consumer_connector_type: redirect
    state: present

- name: Remove a Service Graph
  cisco.mso.mso_schema_site_service_graph_node:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema1
    template: Template1
    service_graph: SG1
    site: site1
    state: absent

- name: Query a specific Service Graph
  cisco.mso.mso_schema_site_service_graph_node:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema1
    template: Template1
    service_graph: SG1
    site: site1
    state: query
  register: query_result

- name: Query all Service Graphs
  cisco.mso.mso_schema_site_service_graph_node:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema1
    template: Template1
    site: site1
    state: query
  register: query_result

作者

  • Shreyas Srish (@shrsr)