theko2fi / theko2fi.multipass / 0.3.0 / module / multipass_vm_info Retrieves facts about Multipass virtual machine Authors: Kenneth KOFFI (@theko2fi)theko2fi.multipass.multipass_vm_info (0.3.0) — module
Install with ansible-galaxy collection install theko2fi.multipass:==0.3.0
collections: - name: theko2fi.multipass version: 0.3.0
Retrieves facts about a Multipass virtual machine.
Essentially returns the output of C(multipass info <name>), similar to what M(theko2fi.multipass.multipass_vm) returns for a non-absent virtual machine.
- 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
name: description: - The name of the virtual machine to inspect. required: true type: str
exists: description: - Returns whether the virtual machine exists. returned: always sample: true type: bool result: description: - Facts representing the current state of the virtual machine. Matches the multipass info output. - Will be V(none) if virtual machine does not exist. returned: always sample: '{ "errors": [], "info": { "foo": { "cpu_count": "1", "disks": { "sda1": { "total": "5120710656", "used": "2200540672" } }, "image_hash": "fe102bfb3d3d917d31068dd9a4bd8fcaeb1f529edda86783f8524fdc1477ee29", "image_release": "22.04 LTS", "ipv4": [ "172.23.240.92" ], "load": [ 0.01, 0.01, 0 ], "memory": { "total": 935444480, "used": 199258112 }, "mounts": { }, "release": "Ubuntu 22.04.2 LTS", "state": "Running" } } }' type: dict