- Notifications
You must be signed in to change notification settings - Fork0
Manage Lima VMs with Puppet Bolt
License
jay7x/puppet-lima
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Table of Contents
The Lima module is a "glue" between Puppet Bolt andlima
You will need to have installedlimactl
on the system you wish to run Bolt from.
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.
groups: -name:lima-vmstargets: -_plugin:limaexcept_matching_names:'^default'
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 documentation for the module is generated usingpuppet-strings and available inREFERENCE.md
About
Manage Lima VMs with Puppet Bolt