dellemc.unity.cifsserver 模块 – 管理 Unity 存储系统上的 CIFS 服务器

注意

此模块是 dellemc.unity 集合 (版本 2.0.0) 的一部分。

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

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

要在剧本中使用它,请指定: dellemc.unity.cifsserver

dellemc.unity 1.4.0 中的新增功能

概要

  • 管理 Unity 存储系统上的 CIFS 服务器包括创建 CIFS 服务器、获取 CIFS 服务器详细信息和删除 CIFS 服务器。

要求

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

  • Dell Unity 存储设备版本 5.1 或更高版本。

  • Ansible-core 2.14 或更高版本。

  • Python 3.9、3.10 或 3.11。

  • Storops Python SDK 1.2.11。

参数

参数

注释

cifs_server_id

字符串

CIFS 服务器的 ID。

cifs_server_name

字符串

CIFS 服务器的名称。

domain

字符串

SMB 服务器在 Active Directory 中注册的域名。

domain_password

字符串

Active Directory 域密码。

domain_username

字符串

Active Directory 域用户名。

interfaces

列表 / 元素=字符串

提供 SMB 服务器 CIFS 协议服务的 IP 接口列表。

local_password

字符串

独立 SMB 服务器管理员密码。

nas_server_id

字符串

将托管 CIFS 服务器的 NAS 服务器的 ID。

nas_server_name

字符串

将托管 CIFS 服务器的 NAS 服务器的名称。

netbios_name

字符串

SMB 服务器在 Windows 网络中的计算机名。

password

字符串 / 必需

Unity 管理服务器的密码。

port

整数

与 Unity 管理服务器进行通信的端口号。

默认值: 443

state

字符串 / 必需

定义 CIFS 服务器是否存在。

选项

  • "absent"

  • "present"

unispherehost

字符串 / 必需

Unity 管理服务器的 IP 或 FQDN。

unjoin_cifs_server_account

布尔值

删除后,保持 SMB 服务器帐户未加入 Active Directory。

false 指定删除后保持 SMB 服务器帐户已加入。

true 指定在删除之前将 SMB 服务器帐户从 Active Directory 中取消加入。

选项

  • false

  • true

username

字符串 / 必需

Unity 管理服务器的用户名。

validate_certs

别名:verifycert

布尔值

布尔变量,用于指定是否验证 SSL 证书。

true - 表示应验证 SSL 证书。

false - 表示不应验证 SSL 证书。

选项

  • false

  • true ← (默认)

workgroup

字符串

独立 SMB 服务器工作组。

备注

注意

  • 支持检查模式

  • 此集合中名为“dellemc.unity”的模块旨在支持 Dell Unity 存储平台。

示例

- name: Create CIFS server belonging to Active Directory
  dellemc.unity.cifsserver:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    nas_server_name: "test_nas1"
    cifs_server_name: "test_cifs"
    domain: "ad_domain"
    domain_username: "domain_username"
    domain_password: "domain_password"
    state: "present"

- name: Get CIFS server details using CIFS server ID
  dellemc.unity.cifsserver:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    cifs_server_id: "cifs_37"
    state: "present"

- name: Get CIFS server details using NAS server name
  dellemc.unity.cifsserver:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    nas_server_name: "test_nas1"
    state: "present"

- name: Delete CIFS server
  dellemc.unity.cifsserver:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    cifs_server_id: "cifs_37"
    unjoin_cifs_server_account: true
    domain_username: "domain_username"
    domain_password: "domain_password"
    state: "absent"

- name: Create standalone CIFS server
  dellemc.unity.cifsserver:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    netbios_name: "ANSIBLE_CIFS"
    workgroup: "ansible"
    local_password: "Password123!"
    nas_server_name: "test_nas1"
    state: "present"

- name: Get CIFS server details using netbios name
  dellemc.unity.cifsserver:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    netbios_name: "ANSIBLE_CIFS"
    state: "present"

- name: Delete standalone CIFS server
  dellemc.unity.cifsserver:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    cifs_server_id: "cifs_40"
    state: "absent"

返回值

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

描述

changed

布尔值

资源是否已更改。

已返回:始终

示例: true

cifs_server_details

字典

CIFS 服务器的详细信息。

已返回:当 CIFS 服务器存在时

示例: {"description": null, "domain": "xxx.xxx.xxx.com", "existed": true, "file_interfaces": {"UnityFileInterfaceList": [{"UnityFileInterface": {"hash": -9223363258905013637, "id": "if_43"}}]}, "hash": -9223363258905010379, "health": {"UnityHealth": {"hash": 8777949765559}}, "id": "cifs_40", "is_standalone": false, "last_used_organizational_unit": "ou=Computers,ou=Dell NAS servers", "name": "ansible_cifs", "nas_server": {"UnityNasServer": {"hash": 8777949765531, "id": "nas_18"}}, "netbios_name": "ANSIBLE_CIFS", "smb_multi_channel_supported": true, "smb_protocol_versions": ["1.0", "2.0", "2.1", "3.0"], "smbca_supported": true, "workgroup": null}

description

字符串

SMB服务器描述。

返回:成功

domain

字符串

SMB服务器在Active Directory中注册的域名。

返回:成功

file_interfaces

字典

与NAS服务器关联的文件接口。

返回:成功

UnityFileInterfaceList

列表 / 元素=字符串

与NAS服务器关联的文件接口列表。

返回:成功

UnityFileInterface

字典

与NAS服务器关联的文件接口详细信息。

返回:成功

id

字符串

文件接口的唯一标识符。

返回:成功

id

字符串

CIFS服务器实例的唯一标识符。

返回:成功

is_standalone

布尔值

指示SMB服务器是否为独立服务器。

返回:成功

name

字符串

用户指定的SMB服务器名称。

返回:成功

nasServer

字典

存储系统中NAS服务器的信息。

返回:成功

UnityNasServer

字典

存储系统中NAS服务器的信息。

返回:成功

id

字符串

NAS服务器实例的唯一标识符。

返回:成功

netbios_name

字符串

SMB服务器在Windows网络中的计算机名。

返回:成功

smb_multi_channel_supported

布尔值

指示是否支持SMB 3.0+多通道功能。

返回:成功

smb_protocol_versions

列表 / 元素=字符串

支持的SMB协议,例如1.0、2.0、2.1、3.0等。

返回:成功

smbca_supported

布尔值

指示SMB服务器是否支持持续可用性。

返回:成功

workgroup

字符串

SMB服务器的Windows网络工作组。

返回:成功

作者

  • Akash Shendge (@shenda1)