Forge Home

lima

Puppet Bolt tasks to manage VMs in a lima-vm environment

847 downloads

215 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.1.1 (latest)
  • 1.1.0
  • 1.0.0
  • 0.0.2
  • 0.0.1
released Feb 21st 2023
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 9.0.0
  • , , , , , , , ,
Tasks:
  • delete
  • list
  • resolve_reference
  • start
  • stop
Plans:
  • delete
  • start
  • stop
  • clusters

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'jay7x-lima', '1.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jay7x-lima
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jay7x-lima --version 1.1.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

jay7x/lima — version 1.1.1 Feb 21st 2023

lima

Table of Contents

  1. Description
  2. Requirements
  3. Inventory plugin usage
  4. Cluster management plans usage

Description

The Lima module is a "glue" between Puppet Bolt and lima

Requirements

You will need to have installed limactl on the system you wish to run Bolt from.

Inventory plugin usage

The resolve_reference task supports looking up target objects from a limactl list output. It accepts following parameters:

  • limactl: Location of the limactl binary if not in $PATH.
  • only_matching_names: Only VM with names matching this regex will be included into the inventory. This regex is passed to Regexp.new() as a string.
  • except_matching_names: VMs with names matching this regex will be excluded from the inventory. This regex is passed to Regexp.new() as a string.

NOTE 1: Only running VMs are returned.

NOTE 2: If both only_matching_names and except_matching_names are specified then only VMs matching only_matching_names and not matching except_matching_names are returned.

Examples

groups:
  - name: lima-vms
    targets:
      - _plugin: lima
        except_matching_names: '^default'

Cluster management plans usage

This module provides a way to define and manage clusters of Lima VMs. It's expected to define clusters in the plan_hierarchy of your Bolt project's Hiera.

Below is the example of a Hiera file under plan_hierarchy:

---
# Leverage YAML features to define templates required
x-ubuntu2004: &ubuntu2004
  images:
  - location: "https://cloud-images.ubuntu.com/releases/20.04/release-20230117/ubuntu-20.04-server-cloudimg-amd64.img"
    arch: "x86_64"
    digest: "sha256:3e44e9f886eba6b91662086d24028894bbe320c1de89be5c091019fedf9c5ce6"
  - location: "https://cloud-images.ubuntu.com/releases/20.04/release-20230117/ubuntu-20.04-server-cloudimg-arm64.img"
    arch: "aarch64"
    digest: "sha256:4ea4700f7b1de194a2f6bf760b911ea3071e0309fcea14d3a465a3323d57c60e"
  - location: "https://cloud-images.ubuntu.com/releases/20.04/release/ubuntu-20.04-server-cloudimg-amd64.img"
    arch: "x86_64"
  - location: "https://cloud-images.ubuntu.com/releases/20.04/release/ubuntu-20.04-server-cloudimg-arm64.img"
    arch: "aarch64"
  mounts:
  - location: "~"

# Cluster definitions
lima::clusters:
  example: # `example` cluster
    nodes:
      - example1
        template: ubuntu  # Use latest ubuntu version on this VM
      - example2
      - example3
    config:
      <<: *ubuntu2004

Now when you have some clusters defined you can use cluster management plans to start/stop/delete a cluster. E.g.:

# Start the cluster (create example[123] VMs)
bolt plan run lima::cluster::start name=example
# Stop the cluster (stop example[123] VMs)
bolt plan run lima::cluster::stop name=example
# Delete the cluster (delete example[123] VMs)
bolt plan run lima::cluster::delete name=example

Reference

Reference documentation for the module is generated using puppet-strings and available in REFERENCE.md