Skip to content

theko2fi/ansible-multipass-collection

Repository files navigation

Ansible Collection - theko2fi.multipass

This repo contains the theko2fi.multipass Ansible Collection. The collection includes many modules and plugins to work with Multipass.

Please note that this collection is not developed by Canonical team. Therefore, it's an UNOFFICIAL collection.

Included content

  • Connection plugins:
    • multipass - Run tasks in Multipass virtual machines
  • Modules:
  • Roles:
    • molecule_multipass - Molecule Multipass driver

Installation

Before using the Multipass collection, you need to install the collection with the ansible-galaxy CLI:

ansible-galaxy collection install theko2fi.multipass

You can also include it in a requirements.yml file and install it via ansible-galaxy collection install -r requirements.yml using the format:

collections:
- name: theko2fi.multipass

See Ansible Using collections for more details.

Usage

It's preferable to use content in this collection using their Fully Qualified Collection Namespace (FQCN), for example theko2fi.multipass.multipass_vm. The sample playbook below will create a Multipass VM, add the VM to the inventory and test the connection to it.

---
- name: Prepare
  hosts: localhost
  connection: local
  tasks:
    - name: Create a Multipass VM
      theko2fi.multipass.multipass_vm:
        name: foo
        cpus: 2
        memory: 2G
        disk: 8G
        state: started
    - name: Add the VM to the inventory
      ansible.builtin.add_host:
        name: foo
        ansible_host: foo
        ansible_connection: theko2fi.multipass.multipass
        ansible_python_interpreter: '/usr/bin/python3'

- name: Run a play against the multipass VM
  hosts: foo
  tasks:
    - name: Ping
      ansible.builtin.ping:

Collection Documentation

The full documentation can be found at https://theko2fi.github.io/ansible-multipass-collection/branch/main/.

Please check it out.

Contributing to this collection

Any kind of contribution (pull request, bug report, code review) are welcome on the project GitHub repository.

If you want to develop new content for this collection or improve what is already here, the easiest way to work on the collection is to fork the project and work on it there. I would be happy to merge your pull request if it passes the integration test.

You can find more information in the developer guide for collections.

Licensing

This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later.

See LICENSES/GPL-3.0-or-later.txt for the full text.