purestorage.flasharray.purefa_dirsnap 模块 – 管理 FlashArray 文件系统目录快照
注意
此模块是 purestorage.flasharray 集合 (版本 1.32.0) 的一部分。
如果您使用的是 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install purestorage.flasharray
。您需要其他要求才能使用此模块,请参阅 需求 以了解详细信息。
要在 playbook 中使用它,请指定: purestorage.flasharray.purefa_dirsnap
。
purestorage.flasharray 1.9.0 中的新增功能
概要
创建/删除 FlashArray 文件系统目录快照
完整的快照名称以 DIR.CLIENT_NAME.SUFFIX 的形式构建,其中 DIR 是托管目录名称,CLIENT_NAME 是客户端名称,SUFFIX 是后缀。
客户端可见的快照名称是 CLIENT_NAME.SUFFIX。
需求
执行此模块的主机需要以下需求。
python >= 3.3
purestorage >= 1.19
py-pure-client >= 1.26.0
netaddr
requests
pycountry
urllib3
参数
参数 |
注释 |
---|---|
具有管理员权限用户的 FlashArray API 令牌。 |
|
客户端可见快照名称的客户端名称部分 |
|
禁用调试日志中的不安全证书警告 选项
|
|
定义在删除时是否清除快照或将其保留在回收站中 选项
|
|
FlashArray 管理 IPv4 地址或主机名。 |
|
目录链接到的文件系统的名称。 |
|
保留期,在此之后将清除快照 以秒为单位指定。范围 300 - 31536000(5 分钟到 1 年) 值为 0 将设置无保留期。 如果在创建时未指定,则默认为 0(无保留期) |
|
要快照的目录的名称 |
|
执行重命名时的新的客户端名称 |
|
执行重命名时的新的后缀 |
|
是否重命名目录快照 可以更改快照客户端名称和后缀 与 *new_client* 和 *new_suffix* 一起使用时必需 选项
|
|
定义目录快照是否存在。 选项
|
|
要使用的快照后缀 |
备注
注意
此模块需要
purestorage
和py-pure-client
Python 库特定模块可能需要其他 Python 库。
如果 *fa_url* 和 *api_token* 参数未直接传递给模块,则必须设置
PUREFA_URL
和PUREFA_API
环境变量
示例
- name: Create a snapshot direcotry foo in filesysten bar for client test with suffix test
purestorage.flasharray.purefa_dirsnap:
name: foo
filesystem: bar
client: test
suffix: test
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Update retention time for a snapshot foo:bar.client.test
purestorage.flasharray.purefa_dirsnap:
name: foo
filesystem: bar
client: client
suffix: test
keep_for: 300 # 5 minutes
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Delete snapshot foo:bar.client.test
purestorage.flasharray.purefa_dirsnap:
name: foo
filesystem: bar
client: client
suffix: test
state: absent
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Recover deleted snapshot foo:bar.client.test
purestorage.flasharray.purefa_dirsnap:
name: foo
filesystem: bar
client: client
suffix: test
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Delete and eradicate snapshot foo:bar.client.test
purestorage.flasharray.purefa_dirsnap:
name: foo
filesystem: bar
client: client
suffix: test
state: absent
eradicate: true
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Eradicate deleted snapshot foo:bar.client.test
purestorage.flasharray.purefa_dirsnap:
name: foo
filesystem: bar
client: client
suffix: test
eradicate: true
state: absent
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Rename snapshot
purestorage.flasharray.purefa_dirsnap:
name: foo
filesystem: bar
client: client
suffix: test
rename: true
new_client: client2
new_suffix: test2
fa_url: 10.10.10.2
api_token: e31060a7-21fc-e277-6240-25983c6c4592