Forge Home

incus_inventory

A task to generate Bolt inventory from Incus or LXD

131 downloads

131 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

  • 0.1.0 (latest)
released Jan 23rd 2024
This version is compatible with:
  • Puppet Enterprise 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
  • Puppet >= 7.0.0 < 9.0.0
  • , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'h0tw1r3-incus_inventory', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add h0tw1r3-incus_inventory
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install h0tw1r3-incus_inventory --version 0.1.0

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

h0tw1r3/incus_inventory — version 0.1.0 Jan 23rd 2024

Incus and LXD inventory for Bolt

Table of Contents

  1. Description
  2. Requirements
  3. Usage
  4. Examples

Description

A Bolt plugin for dynamically generating targets for instances managed by Incus or LXD.

Requirements

  • A working client configuration with at least one remote. Does not require the client, REST API calls are made directly.

If the command incus list or lxd list works, this plugin should too.

Usage

Inventory task parameters:

parameter type description default
all_projects Boolean query all projects false
filter Optional[String] instances collection filter passed directly to api call
project Optional[String] limit instances to specific project
provider Optional[Enum['incus', 'lxd']] which service to use, prefers incus if unset
remote Optional[String] name of remote in configuration
target_mapping Hash hash of target attributes to populate with resource values { name: name }

Examples

groups:
  - name: containers on dc1 remote
    targets:
      - _plugin: incus_inventory
        remote: dc1
        filter: type eq container
  - name: vms on default remote
    targets:
      - _plugin: incus_inventory
        filter: type eq virtual-machine
        target_mapping:
          name: name
          alias: state.network.nic0.addresses.0.address
          vars:
            arch: architecture
  - name: all debian instances
    targets:
      - _plugin: incus_inventory
        filter: config.image.os eq Debian