qiyutech.proxmox.hl_task_status module – PVE 任务状态检查

备注

This module is part of the qiyutech.proxmox collection (version 1.0.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install qiyutech.proxmox.

To use it in a playbook, specify: qiyutech.proxmox.hl_task_status.

1.0.0 新版功能: of qiyutech.proxmox

Synopsis

  • 等待 PVE 的任务执行到指定状态

备注

This module has a corresponding action plugin.

Parameters

Parameter

Comments

host

string / required

Proxmox API server

这个参数是必须的

参数获取顺序:

1 host 任务参数

2 proxmox_host 变量 (aka: task_vars 中的 proxmox_host 变量)

3 PROXMOX_HOST 任务环境变量

4 PROXMOX_HOST 全局环境变量

interval

integer

检测间隔时间

单位: 秒

Default: 2

node

string / required

PVE集群节点名称

status

string

任务状态

Choices:

  • running

  • stopped ← (default)

token_id

string / required

Proxmox API Token ID

这个参数是必须的

参数获取顺序:

1 token_id 任务参数

2 proxmox_token_id 变量 (aka: task_vars 中的 proxmox_token_id 变量)

3 PROXMOX_TOKEN_ID 任务环境变量

4 PROXMOX_TOKEN_ID 全局环境变量

token_secret

string / required

Proxmox API Token Secret

这个参数是必须的

参数获取顺序:

1 token_secret 任务参数

2 proxmox_token_secret 变量 (aka: task_vars 中的 proxmox_token_secret 变量)

3 PROXMOX_TOKEN_SECRET 任务环境变量

4 PROXMOX_TOKEN_SECRET 全局环境变量

upid

string / required

PVE 任务ID

Examples

- name: Wait for PVE task stopped
  qiyutech.proxmox.hl_task_status:
    node: kimsufi
    upid: "xxx"
    status: "stopped"

- name: Wait for PVE task running
  qiyutech.proxmox.hl_task_status:
    node: kimsufi
    upid: "xxx"
    status: "running"

Authors

  • dev