--- # The input rules the argument spec cannot express. main.yml imports this file under # tags: always, before any change; each assert keeps the condition under which its input is read. # Every run calls the API: even pve_vm_state absent without pve_vm_allow_destroy looks the VM up. - name: Assert the Proxmox API credentials are set ansible.builtin.assert: that: - pve_vm_api_user | length > 0 - pve_vm_api_token_secret is defined and pve_vm_api_token_secret | length > 0 fail_msg: >- The Proxmox API calls need pve_vm_api_user (bare user name, the role appends @) and pve_vm_api_token_secret (normally vaulted). Neither has a usable default: set them in the inventory. quiet: true # The update reads the resize flag, which is only computed while pve_vm_disk_size is defined. - name: Assert the boot disk size is set while the disk is managed ansible.builtin.assert: that: - pve_vm_disk_size is defined fail_msg: >- pve_vm_disk_size (for example 32G) must be set while pve_vm_manage_disk is true, the default. Set pve_vm_manage_disk to false to leave the boot disk alone. quiet: true when: - pve_vm_manage_disk | bool - pve_vm_state != "absent"