Incus and LXD inventory for Bolt
Table of Contents
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