cisco.ise.guest_user 模块 –访客用户资源模块

注意

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

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

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

要在playbook中使用它,请指定:cisco.ise.guest_user

cisco.ise 1.0.0中的新增功能

概要

  • 管理访客用户资源的创建、更新和删除操作。

  • 此API创建访客用户。

  • 此API通过ID删除访客用户。

  • 此API删除访客用户。

  • 此API允许客户端通过ID更新访客用户。

  • 此API允许客户端通过名称更新访客用户。

注意

此模块具有相应的action插件

要求

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

  • ciscoisesdk >= 2.2.3

  • python >= 3.5

参数

参数

注释

customFields

字典

键值映射。

description

字符串

访客用户的描述。

guestAccessInfo

字典

访客用户的guestAccessInfo。

fromDate

字符串

访客用户的fromDate。

groupTag

字符串

访客用户的groupTag。

location

字符串

访客用户的location。

ssid

字符串

访客用户的ssid。

toDate

字符串

访客用户的toDate。

validDays

整数

访客用户的validDays。

guestInfo

字典

访客用户的guestInfo。

company

字符串

访客用户的公司。

creationTime

字符串

访客用户的creationTime。

emailAddress

字符串

访客用户的电子邮件地址。

enabled

布尔值

此字段仅用于获取操作,不适用于创建、更新操作。

选项

  • false

  • true

firstName

字符串

访客用户的firstName。

lastName

字符串

访客用户的lastName。

notificationLanguage

字符串

访客用户的notificationLanguage。

password

字符串

访客用户的密码。

phoneNumber

字符串

电话号码应为E.164格式。

smsServiceProvider

字符串

访客用户的smsServiceProvider。

userName

字符串

如果需要使用手机号创建帐户,请在此处提供手机号。

guestType

字符串

访客用户的guestType。

id

字符串

访客用户的ID。

ise_debug

布尔值

用于Identity Services Engine SDK以启用调试的标志。

选项

  • false ← (默认)

  • true

ise_hostname

字符串 / 必需

Identity Services Engine主机名。

ise_password

字符串 / 必需

用于身份验证的Identity Services Engine密码。

ise_single_request_timeout

整数

在cisco.ise 3.0.0中添加

RESTful HTTP请求的超时时间(以秒为单位)。

默认值: 60

ise_username

字符串 / 必需

用于身份验证的Identity Services Engine用户名。

ise_uses_api_gateway

布尔值

在cisco.ise 1.1.0中添加

通知SDK是否使用Identity Services Engine的API Gateway发送请求的标志。

如果为true,则使用ISE的API Gateway并将请求发送到https://{{ise_hostname}}。

如果为false,则将请求发送到https://{{ise_hostname}}:{{port}},其中端口值取决于使用的服务(ERS、Mnt、UI、PxGrid)。

选项

  • false

  • true ← (默认)

ise_uses_csrf_token

布尔值

在cisco.ise 3.0.0中添加

通知SDK我们是否将CSRF令牌发送到ISE的ERS API的标志。

如果为True,则SDK假定您的ISE CSRF检查已启用。

如果为True,则假定您需要SDK自动为您管理CSRF令牌。

选项

  • false ← (默认)

  • true

ise_verify

布尔值

启用或禁用SSL证书验证的标志。

选项

  • false

  • true ← (默认)

ise_version

字符串

通知SDK要使用的Identity Services Engine版本。

默认值: "3.1_Patch_1"

ise_wait_on_rate_limit

布尔值

用于Identity Services Engine SDK以启用自动速率限制处理的标志。

选项

  • false

  • true ← (默认)

name

字符串

访客用户的名称。

portalId

字符串

访客用户的portalId。

reasonForVisit

字符串

访客用户的访问原因。

sponsorUserId

字符串

访客用户的担保人用户ID。

sponsorUserName

字符串

访客用户的担保人用户名。

status

字符串

访客用户的状态。

statusReason

字符串

访客用户的状态原因。

备注

注意

  • 使用的SDK方法是guest_user.GuestUser.create_guest_user、guest_user.GuestUser.delete_guest_user_by_id、guest_user.GuestUser.delete_guest_user_by_name、guest_user.GuestUser.update_guest_user_by_id、guest_user.GuestUser.update_guest_user_by_name,

  • 使用的路径是post /ers/config/guestuser、delete /ers/config/guestuser/name/{name}、delete /ers/config/guestuser/{id}、put /ers/config/guestuser/name/{name}、put /ers/config/guestuser/{id},

  • 不支持check_mode

  • 插件在控制节点上运行,不使用任何ansible连接插件,而是使用Cisco ISE SDK中的嵌入式连接管理器

  • 以ise_开头的参数由Cisco ISE Python SDK用于建立连接

示例

- name: Update by name
  cisco.ise.guest_user:
    ise_hostname: "{{ise_hostname}}"
    ise_username: "{{ise_username}}"
    ise_password: "{{ise_password}}"
    ise_verify: "{{ise_verify}}"
    state: present
    customFields: {}
    description: string
    guestAccessInfo:
      fromDate: string
      groupTag: string
      location: string
      ssid: string
      toDate: string
      validDays: 0
    guestInfo:
      company: string
      creationTime: string
      emailAddress: string
      enabled: true
      firstName: string
      lastName: string
      notificationLanguage: string
      password: string
      phoneNumber: string
      smsServiceProvider: string
      userName: string
    guestType: string
    id: string
    name: string
    portalId: string
    reasonForVisit: string
    sponsorUserId: string
    sponsorUserName: string
    status: string
    statusReason: string

- name: Delete by name
  cisco.ise.guest_user:
    ise_hostname: "{{ise_hostname}}"
    ise_username: "{{ise_username}}"
    ise_password: "{{ise_password}}"
    ise_verify: "{{ise_verify}}"
    state: absent
    name: string

- name: Update by id
  cisco.ise.guest_user:
    ise_hostname: "{{ise_hostname}}"
    ise_username: "{{ise_username}}"
    ise_password: "{{ise_password}}"
    ise_verify: "{{ise_verify}}"
    state: present
    customFields: {}
    description: string
    guestAccessInfo:
      fromDate: string
      groupTag: string
      location: string
      ssid: string
      toDate: string
      validDays: 0
    guestInfo:
      company: string
      creationTime: string
      emailAddress: string
      enabled: true
      firstName: string
      lastName: string
      notificationLanguage: string
      password: string
      phoneNumber: string
      smsServiceProvider: string
      userName: string
    guestType: string
    id: string
    name: string
    portalId: string
    reasonForVisit: string
    sponsorUserId: string
    sponsorUserName: string
    status: string
    statusReason: string

- name: Delete by id
  cisco.ise.guest_user:
    ise_hostname: "{{ise_hostname}}"
    ise_username: "{{ise_username}}"
    ise_password: "{{ise_password}}"
    ise_verify: "{{ise_verify}}"
    state: absent
    id: string

- name: Create
  cisco.ise.guest_user:
    ise_hostname: "{{ise_hostname}}"
    ise_username: "{{ise_username}}"
    ise_password: "{{ise_password}}"
    ise_verify: "{{ise_verify}}"
    state: present
    customFields: {}
    description: string
    guestAccessInfo:
      fromDate: string
      groupTag: string
      location: string
      ssid: string
      toDate: string
      validDays: 0
    guestInfo:
      company: string
      creationTime: string
      emailAddress: string
      enabled: true
      firstName: string
      lastName: string
      notificationLanguage: string
      password: string
      phoneNumber: string
      smsServiceProvider: string
      userName: string
    guestType: string
    name: string
    portalId: string
    reasonForVisit: string
    sponsorUserId: string
    sponsorUserName: string
    status: string
    statusReason: string

返回值

常见的返回值已在此处记录,以下是此模块独有的字段

描述

ise_response

字典

包含Cisco ISE Python SDK返回的响应的字典或列表

返回:始终

示例: {"customFields": {}, "description": "string", "guestAccessInfo": {"fromDate": "string", "groupTag": "string", "location": "string", "ssid": "string", "toDate": "string", "validDays": 0}, "guestInfo": {"company": "string", "creationTime": "string", "emailAddress": "string", "enabled": true, "firstName": "string", "lastName": "string", "notificationLanguage": "string", "password": "string", "phoneNumber": "string", "smsServiceProvider": "string", "userName": "string"}, "guestType": "string", "id": "string", "link": {"href": "string", "rel": "string", "type": "string"}, "name": "string", "portalId": "string", "reasonForVisit": "string", "sponsorUserId": "string", "sponsorUserName": "string", "status": "string", "statusReason": "string"}

ise_update_response

字典

在cisco.ise 1.1.0中添加

包含Cisco ISE Python SDK返回的响应的字典或列表

返回:始终

示例: {"UpdatedFieldsList": {"field": "string", "newValue": "string", "oldValue": "string", "updatedField": [{"field": "string", "newValue": "string", "oldValue": "string"}]}}

作者

  • Rafael Campos (@racampos)