theko2fi.multipass.multipass connection – Run tasks in Multipass virtual machines

Note

This connection plugin 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.

Synopsis

  • Run commands or put/fetch files to an existing multipass VM.

  • Uses the multipass CLI to execute commands in the virtual machine.

Parameters

Parameter

Comments

remote_addr

string

The name of the VM you want to access.

Default: "inventory_hostname"

Configuration:

  • Variable: inventory_hostname

  • Variable: ansible_host

  • Variable: ansible_multipass_host

Notes

Note

  • The theko2fi.multipass.multipass connection plugin does not support using the ``remote_user`` and ``ansible_user`` variables to configure the remote user. Remote commands will often default to running as ``ubuntu`` user.

Examples

# sample inventory.yml file where `foo` is the name of the Multipass VM:
all:
  hosts:
    foo:
      ansible_host: foo
      ansible_connection: theko2fi.multipass.multipass
      ansible_python_interpreter: /usr/bin/python3

# Execution: ansible-playbook -i inventory.yml playbook.yml
# The playbook tasks will get executed on the multipass VM

Authors

  • Kenneth KOFFI (@theko2fi)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.