Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Manage Lima VMs with Puppet Bolt

License

NotificationsYou must be signed in to change notification settings

jay7x/puppet-lima

Repository files navigation

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 andlima

Requirements

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

Inventory plugin usage

Theresolve_reference task supports looking up target objects from alimactl list output. It accepts following parameters:

  • limactl: Location of thelimactl 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 toRegexp.new() as a string.
  • except_matching_names: VMs with names matching this regex will be excluded from the inventory. This regex is passed toRegexp.new() as a string.

NOTE 1: Onlyrunning VMs are returned.

NOTE 2: If bothonly_matching_names andexcept_matching_names are specified then only VMs matchingonly_matching_names and not matchingexcept_matching_names are returned.

Examples

groups:  -name:lima-vmstargets:      -_plugin:limaexcept_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 theplan_hierarchy of your Bolt project's Hiera.

Below is the example of a Hiera file underplan_hierarchy:

---# Leverage YAML features to define templates requiredx-ubuntu2004:&ubuntu2004images:  -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 definitionslima::clusters:example:# `example` clusternodes:      -example1template:ubuntu# Use latest ubuntu version on this VM      -example2      -example3config:<<:*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 usingpuppet-strings and available inREFERENCE.md


[8]ページ先頭

©2009-2025 Movatter.jp