cisco.mso.mso_tenant_site 模块 – 使用云站点管理租户。

注意

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

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

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

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

概要

  • 在 Cisco ACI 多站点上使用云站点管理租户。

要求

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

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

参数

参数

注释

aws_access_key

字符串

AWS 帐户的访问密钥 ID。当 aws_trusted 设置为 false 时,这是必需的。

aws_account_org

布尔值

组织的 AWS 帐户。

选项

  • false ← (默认)

  • true

aws_trusted

布尔值

AWS 帐户以信任模式访问。设置为 false 时需要凭据。

选项

  • false

  • true

azure_access_type

字符串

Azure 的托管模式。

Azure 的非托管模式。

如果未指定属性,则为共享模式。

选项

  • "managed"

  • "unmanaged"

  • "shared" ← (默认)

azure_active_directory_id

字符串

Azure 帐户的活动目录 ID。

当 azure_access_type 处于非托管模式时,此属性是必需的。

azure_active_directory_name

字符串

Azure 帐户的活动目录名称。例如,活动目录名称为“CiscoINSBUAd”。

当 azure_access_type 处于非托管模式时,此属性是必需的。

azure_application_id

字符串

Azure 帐户的应用程序 ID。

当 azure_access_type 处于托管模式或非托管模式时,此属性是必需的。

azure_credential_name

字符串

Azure 帐户的凭据名称。

当 azure_access_type 处于非托管模式时,此属性是必需的。

azure_subscription_id

字符串

Azure 帐户的订阅 ID。

当 azure_access_type 处于托管模式或非托管模式时,此属性是必需的。

cloud_account

字符串

云站点必需。

AWS 的帐户 ID,格式为“000000000000”。

Azure 的帐户 ID,格式为“uni/tn-(tenant_name)/act-[(subscription_id)]-azure_vendor-azure”。

Azure 帐户 ID 中的示例值:`(tenant_name)=tenant_test` 和 `(subscription_id)=10`。

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的值。

secret_key

字符串

AWS 非信任帐户的密钥。当 aws_trusted 设置为 false 时需要。

Azure 帐户的密钥,用于非托管身份。在 Azure 帐户的非托管模式下需要。

security_domains

列表 / 元素=字符串

站点的安全域列表。

默认值: []

站点

别名:名称

字符串

站点的名称。

这可以是云站点或非云站点。

状态

字符串

使用presentabsent 添加或删除。

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

选项

  • "absent"

  • "present" ← (默认)

  • "query"

租户

字符串 / 必需

租户的名称。

超时

整数

套接字级别超时(秒)。

默认值为 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

使用 HTTPAPI 连接插件(mso 或 nd)时默认值为false,使用传统连接方法(仅限于 mso)时默认值为true

选项

  • false

  • true

用户名

字符串

用于身份验证的用户名。

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

validate_certs

布尔值

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

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

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

默认值为true

选项

  • false

  • true

注释

注意

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

示例

- name: Associate a non-cloud site with a tenant
  cisco.mso.mso_tenant_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    tenant: tenant_name
    site: site_name
    state: present

- name: Associate AWS site with a tenant, with aws_trusted set to true
  cisco.mso.mso_tenant_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    tenant: tenant_name
    site: site_name
    cloud_account: '000000000000'
    aws_trusted: true
    state: present

- name: Associate AWS site with a tenant, with aws_trusted set to false
  cisco.mso.mso_tenant_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    tenant: tenant_name
    site: AWS
    cloud_account: '000000000000'
    aws_trusted: false
    aws_access_key: '1'
    secret_key: '0'
    aws_account_org: false
    state: present

- name: Associate Azure site in managed mode
  mso.cisco.mso_tenant_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    tenant: tenant_name
    site: site_name
    cloud_account: uni/tn-ansible_test/act-[9]-azure_vendor-azure
    azure_access_type: managed
    azure_subscription_id: '9'
    azure_application_id: '100'
    state: present

- name: Associate Azure site in unmanaged mode
  mso.cisco.mso_tenant_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    tenant: tenant_name
    site: site_name
    cloud_account: uni/tn-ansible_test/act-[9]-azure_vendor-azure
    azure_access_type: unmanaged
    azure_subscription_id: '9'
    azure_application_id: '100'
    azure_credential_name: cApicApp
    secret_key: iins
    azure_active_directory_id: '32'
    azure_active_directory_name: CiscoINSBUAd
    state: present

- name: Dissociate a site
  cisco.mso.mso_tenant_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    tenant: tenant_name
    site: site_name
    state: absent

- name: Query a site
  cisco.mso.mso_tenant_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    tenant: tenant_name
    site: site_name
    state: query
  register: query_result

- name: Query all sites of a tenant
  cisco.mso.mso_tenant_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    tenant: tenant_name
    state: query
  register: query_result

作者

  • Shreyas Srish (@shrsr)