purestorage.flashblade.purefb_lifecycle 模块 – 管理 FlashBlade 对象生命周期
注意
此模块是 purestorage.flashblade 集合 (版本 1.19.1) 的一部分。
如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用: ansible-galaxy collection install purestorage.flashblade。您需要其他要求才能使用此模块,请参阅 要求 获取详细信息。
要在剧本中使用它,请指定: purestorage.flashblade.purefb_lifecycle。
purestorage.flashblade 1.4.0 中的新增功能
概要
- 管理对象存储桶的生命周期 
要求
执行此模块的主机需要以下要求。
- python >= 3.9 
- py-pure-client 
- purity_fb >= 1.12.2 
- netaddr 
- datetime 
- pytz 
- distro 
- pycountry 
- urllib3 
参数
| 参数 | 注释 | 
|---|---|
| 不完整分块上传将被中止的时间长度。 以天 (d) 或周 (w) 为单位输入。范围为 1 - 2147483647 天。 | |
| 具有管理员权限用户的 FlashBlade API 令牌。 | |
| 生命周期规则适用的存储桶 | |
| 禁用不安全证书警告 选项 
 | |
| 生命周期规则的状态 选项 
 | |
| FlashBlade 管理 IP 地址或主机名。 | |
| 当前版本将在多久之后被标记为过期。 以天 (d) 或周 (w) 为单位输入。范围为 1 - 2147483647 天。 | |
| 当前版本将在哪个日期之后被标记为过期。 以 YYYY-MM-DD 的格式输入日期。 **注意:**设置过去的日期将删除所有具有 _prefix_ 值的对象(因为它们是在创建时设置的)。 | |
| 先前版本将在多久之后被标记为过期。 以天 (d) 或周 (w) 为单位输入。范围为 1 - 2147483647 天。 | |
| 生命周期规则的名称 | |
| 标识存储桶中一个或多个对象的 Object key 前缀 | |
| 创建或删除生命周期规则 选项 
 | 
注释
注意
- 此模块需要 - purity_fbPython 库
- 如果未直接将 _fb_url_ 和 _api_token_ 参数传递给模块,则必须设置 - PUREFB_URL和- PUREFB_API环境变量
示例
- name: Create a lifecycle rule called bar for bucket foo (pre-Purity//FB 3.2.3)
  purestorage.flashblade.purefb_lifecycle:
    name: bar
    bucket: foo
    keep_previous_for: 2d
    prefix: test
    fb_url: 10.10.10.2
    api_token: T-9f276a18-50ab-446e-8a0c-666a3529a1b6
- name: Create a lifecycle rule called bar for bucket foo (post-Purity//FB 3.2.3)
  purestorage.flashblade.purefb_lifecycle:
    name: bar
    bucket: foo
    keep_previous_for: 2d
    keep_current_for: 1w
    abort_uploads_after: 1d
    keep_current_until: 2020-11-23
    prefix: test
    fb_url: 10.10.10.2
    api_token: T-9f276a18-50ab-446e-8a0c-666a3529a1b6
- name: Modify a lifecycle rule (post-Purity//FB 3.2.3)
  purestorage.flashblade.purefb_lifecycle:
    name: bar
    bucket: foo
    keep_previous_for: 10d
    fb_url: 10.10.10.2
    api_token: T-9f276a18-50ab-446e-8a0c-666a3529a1b6
- name: Delete lifecycle rule foo from bucket foo
  purestorage.flashblade.purefb_lifecycle:
    name: foo
    bucket: bar
    state: absent
    fb_url: 10.10.10.2
    api_token: T-9f276a18-50ab-446e-8a0c-666a3529a1b6
