f5networks.f5_modules.bigip_provision_async 模块 – 管理 BIG-IP 模块配置
注意
此模块是 f5networks.f5_modules 集合(版本 1.32.1)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install f5networks.f5_modules。
要在 playbook 中使用它,请指定:f5networks.f5_modules.bigip_provision_async。
f5networks.f5_modules 1.25.0 中的新增功能
概要
- 管理 BIG-IP 模块配置。此模块将以异步方式执行配置操作。有关更多信息,请参阅“注意”部分。 
参数
| 参数 | 注释 | 
|---|---|
| 如果  如果使用  选择 
 | |
| 设置请求模块的配置级别。更改一个模块的级别可能需要修改另一个模块的级别。例如,将一个模块更改为  如果 absent,请使用  此参数与  选择 
 | |
| 为管理模块设置额外的内存。这是除了 1264MB 的最小分配 RAM 之外的内存。 接受的值范围为  指定  指定  指定  对于包含 2000 个以上对象的配置,或者更具体地说,对于任何每 2 GB 安装内存超过 1000 个对象的配置,请使用  | |
| 要在 BIG-IP 中配置的模块。 选择 
 | |
| 一个包含连接详细信息的 dict 对象。 | |
| 配置身份验证提供程序以从远程设备获取身份验证令牌。 此选项在处理 BIG-IQ 设备时真正使用。 | |
| 如果为  您可以通过设置环境变量  先前使用的变量  选择 
 | |
| 用于连接到 BIG-IP 或 BIG-IQ 的用户帐户的密码。 您可以通过设置环境变量  | |
| BIG-IP 主机或 BIG-IQ 主机。 您可以通过设置环境变量  | |
| BIG-IP 服务器端口。 您可以通过设置环境变量  默认值:  | |
| 指定与网络设备通信的超时时间(以秒为单位),用于连接或发送命令。如果在操作完成之前超时,模块将报错。 | |
| 配置连接到远程设备时使用的传输连接。 选择 
 | |
| 连接到 BIG-IP 或 BIG-IQ 的用户名。该用户必须具有设备上的管理权限。 您可以通过设置环境变量  | |
| 如果为  您可以通过设置环境变量  选择 
 | |
| 系统上已配置模块的状态。如果为  如果为  
 选择 
 | |
| 等待配置过程完成的时间(以秒为单位)。 可接受的值范围在  如果设备需要重启模块,则它将返回无更改和相应的消息。在这种情况下,您必须暂停 playbook 的执行,直到设备准备就绪(请参阅  默认值:  | 
注释
注意
- 使用 - check_status参数检查配置状态不是幂等的(请参阅- EXAMPLES部分)。
- 该模块允许与 bigip_provision 相同的配置操作,不同之处在于它不会等待服务重启或设备重启。这是为了修复在某些环境中,当使用此模块时可能导致超时或陷入无限循环的边缘情况,尽管配置操作成功。 
- 为了获得最佳效果,请将此模块与 - bigip_wait模块结合使用。
- 此模块需要 TMOS 15.x 及以上版本。 
- 有关使用 Ansible 管理 F5 Networks 设备的更多信息,请参阅 https://ansible.org.cn/integrations/networks/f5。 
- 需要 BIG-IP 软件版本 >= 12。 
- F5 模块仅操作 F5 产品的运行配置。为了确保 BIG-IP 的特定配置持久保存到磁盘,请务必包含至少一个使用 f5networks.f5_modules.bigip_config 模块保存运行配置的任务。有关正确使用模块保存运行配置的方法,请参阅该模块的文档。 
示例
- name: Provision GTM on the device
  bigip_provision_async:
    module: "gtm"
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
- name: Check for provision progress
  bigip_provision_async:
    module: "gtm"
    check_status: true
    status_timeout: 900
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost
  register: status
- name: Wait for 3 minutes if device is restarting services
  bigip_wait:
    timeout: 180
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost
  when:
    - result.message == "Device is restarting services, unable to check provisioning status."
- name: Re-check for provision progress
  bigip_provision_async:
    module: "gtm"
    check_status: true
    status_timeout: 900
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost
  register: status
  when:
    - status.message == "Device is restarting services, unable to check provisioning status."
- name: Provision GTM on the device - Idempotent Check
  bigip_provision_async:
    module: "gtm"
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost
  register: result
  when:
    - status.message == "Device has finished provisioning the requested module."
- name: Assert Provision GTM on the device - Idempotent Check
  assert:
    that:
      - result is not changed
  when:
    - status.message == "Device has finished provisioning the requested module."
- name: Provision VCMP on the device
  bigip_provision_async:
    module: "vcmp"
    level: "dedicated"
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost
- name: Check for provision progress
  bigip_provision_async:
    module: "vcmp"
    level: "dedicated"
    check_status: true
    status_timeout: 900
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost
  register: status
- name: Wait for 10 minutes if device is restarting services
  bigip_wait:
    timeout: 600
    type: vcmp
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost
  when:
    - result.message == "Device is restarting services, unable to check provisioning status."
- name: Re-check for provision progress
  bigip_provision_async:
    module: "vcmp"
    level: "dedicated"
    check_status: true
    status_timeout: 900
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  delegate_to: localhost
  register: status
  when:
    - status.message == "Device is restarting services, unable to check provisioning status."
- name: Provision VCMP on the device - Idempotent Check
  bigip_provision_async:
    module: "vcmp"
    level: "dedicated"
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  register: result
  delegate_to: localhost
  when:
    - status.message == "Device has finished provisioning the requested module."
- name: Assert Provision VCMP on the device - Idempotent Check
  assert:
    that:
      - result is not changed
  when:
    - status.message == "Device has finished provisioning the requested module."
- name: De-provision VCMP on the device
  bigip_provision_async:
    module: "vcmp"
    state: "absent"
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
- name: Check for de-provision progress
  bigip_provision_async:
    module: "vcmp"
    state: "absent"
    check_status: true
    status_timeout: 900
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  register: status
- name: Wait for 10 minutes if device is restarting services
  bigip_wait:
    timeout: 600
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  when:
    - result.message == "Device is restarting services, unable to check provisioning status."
- name: Re-check for de-provision progress
  bigip_provision_async:
    module: "vcmp"
    state: "absent"
    check_status: true
    status_timeout: 900
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  register: status
  when:
    - status.message == "Device is restarting services, unable to check provisioning status."
- name: De-provision VCMP on the device - Idempotent Check
  bigip_provision_async:
    module: "vcmp"
    state: "absent"
    provider:
      server: lb.mydomain.com
      password: secret
      user: admin
  register: result
  when:
    - status.message == "Device has finished de-provisioning the requested module."
- name: Assert Provision VCMP on the device - Idempotent Check
  assert:
    that:
      - result is not changed
  when:
    - status.message == "Device has finished de-provisioning the requested module."
返回值
通用返回值记录在此处,以下是此模块特有的字段
| Key | 描述 | 
|---|---|
| 模块的新配置级别。 返回: changed 示例:  | |
| mgmt 模块的新配置内存量。 返回: changed 示例:  | |
| ansible 任务状态的提示信息。 返回: changed 示例:  | 
