theko2fi.multipass.multipass_vm_info module – Retrieves facts about Multipass virtual machine
Note
This module is part of the theko2fi.multipass collection (version 0.3.0).
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 theko2fi.multipass
.
To use it in a playbook, specify: theko2fi.multipass.multipass_vm_info
.
Synopsis
Retrieves facts about a Multipass virtual machine.
Essentially returns the output of
multipass info <name>
, similar to what theko2fi.multipass.multipass_vm returns for a non-absent virtual machine.
Parameters
Parameter |
Comments |
---|---|
The name of the virtual machine to inspect. |
Examples
- name: Get infos on virtual machine
theko2fi.multipass.multipass_vm_info:
name: foo
register: output
- name: Does virtual machine exist?
ansible.builtin.debug:
msg: "The VM {{ 'exists' if output.exists else 'does not exist' }}"
- name: Print information about virtual machine
ansible.builtin.debug:
var: output.result
when: output.exists
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Returns whether the virtual machine exists. Returned: always Sample: |
|
Facts representing the current state of the virtual machine. Matches the multipass info output. Will be Returned: always Sample: |