Version information
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
- Puppet >= 7.0.0 < 9.0.0
- , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'h0tw1r3-proxmox_inventory', '0.7.1'
Learn more about managing modules with a PuppetfileDocumentation
proxmox_inventory
Table of Contents
Description
This module includes a Bolt plugin to generate targets from Proxmox VE.
Requirements
This Bolt plugin requires the proxmox-api gem to connect to the Proxmox REST API. If it is not installed, the plugin will automatically attempt to when the plugin is executed by Bolt.
You will need a token
and secret
, or username
, password
and realm
to
authenticate.
Usage
The Proxmox inventory plugin supports looking up running LXC and QEMU VMs. It supports several configuration properties.
username
: Do not set if using a tokenpassword
: Do not set if using a tokenrealm
: Do not set if using a tokentoken
: Complete API token (eg. admin@pve!puppetbolt)secret
: Token secrethost
: Hostname of the Proxmox node (any cluster member)port
: API port (optional)verify_ssl
: Set to false if using a self-signed certificatetype
: Filter on VM type, qemu or lxc (optional, default 'all')target_mapping
: A hash of the target attributes to populate with resource values. Proxmox cluster/resources and node configuration attributes are available for mapping. Network interface (eg. net0, net1, ...) string value is converted to a Hash. Default mapping: name: fqdn alias: name uri: net0.ip
Examples
groups:
- name: lxc proxmox containers at dc1
targets:
- _plugin: proxmox_inventory
host: dc1.bogus.site
username: admin
password: supersecret
realm: pve
type: lxc
target_mapping:
name: fqdn
uri: net0.ip
alias: name
vars:
arch: arch
type: type
- name: all proxmox VMs at dc2
targets:
- _plugin: proxmox_inventory
host: dc2.another.site
token: admin@pve!bolt
secret: 095ce810-4e28-11ed-bdc3-0242ac120002
target_mapping:
alias: vmid
Qemu: the agent service must be running on the VM to determine the IP address
Reference
Table of Contents
Tasks
resolve_reference
: Generate targets from Proxmox
Tasks
resolve_reference
Generate targets from Proxmox
Supports noop? false
Parameters
username
Data type: Optional[String]
password
Data type: Optional[String]
otp
Data type: Optional[String]
realm
Data type: Optional[String]
token
Data type: Optional[String]
secret
Data type: Optional[String]
host
Data type: String
port
Data type: Optional[Integer]
verify_ssl
Data type: Optional[Boolean]
type
Data type: Enum['lxc', 'qemu', 'all']
target_mapping
Data type: Hash
Changelog
All notable changes to this project will be documented in this file.
Release 0.7.1
- Fix error when IP is not set
Release 0.7.0
- BREAKING:
net
is no longer an array, usenet0
instead. - Default uri is now
net0.ip
Release 0.6.2
- Fix resolving container DHCP ip address
Release 0.6.0
- Support resolving container DHCP ip address
Release 0.5.0
- Fix missing qemu targets with Proxmox 8
- Add Puppet 8, drop Puppet 6 support
Release 0.4.0
- Provide a default target mapping
- Add fqdn attribute and map to node name by default
- Remove qemu specific agent attribute, normalize net attribute between lxc
and qemu.
agent.net.0.ip
is nownet.0.ip
(same as lxc) - Fix inventory error when nodes have interfaces without ip addresses
- Work-around OSX qemu agent hwaddr reporting bug
Release 0.3.0
- Fix inventory error when QEMU VM's have the agent feature enabled but said agent is not running or reporting an IP address.
Release 0.2.3
- Fix automatic install of the proxmox-api gem
Release 0.2.1
- Token support now working with update to proxmox-api gem
Release 0.2.0
- New required
type
parameter accepts two possible values; lxc, qemu - Filter qemu VMs without agent running
Release 0.1.0
Initial public release
Dependencies
- puppetlabs-ruby_plugin_helper (>= 0.1.0 < 1.0.0)
- puppetlabs-ruby_task_helper (>= 0.4.0 < 1.0.0)
MIT License Copyright (c) 2022 Jeffrey Clark Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.