dynaml
A Bolt inventory plugin which resolves complex values with ERB and external data
Version information
released Nov 29th 2022
This version is compatible with:
- Puppet Enterprise 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, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
- Puppet >= 4.10.0 < 8.0.0
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'h0tw1r3-dynaml', '0.1.0'
Learn more about managing modules with a PuppetfileDocumentation
h0tw1r3/dynaml — version 0.1.0 Nov 29th 2022
Bolt Dynaml plugin
This module provides a Bolt inventory plugin for resolving values with ERB and optionally merging external data.
Table of Contents
Usage
The plugin supports two parameters. Choose either or both.
If both are provided, the plugin will merge or replace value
with the value
of merge.key
in merge.file
.
value
: A string or structure of values to parse with erbmerge
: (optional)file
: yaml file to load, defaults to override.yamlkey
: key in the file to merge with the optional value parameter
merge.file
variables can be referenced by inline erb using the builtin
variable @dynaml
. Key names are symbols.
Examples
version: 2
targets:
- _plugin: puppetdb
query:
_plugin: dynaml
value: "nodes[certname] { report_timestamp<'<%= (Time.now.utc - 1*60).strftime('%FT%T.%LZ') %>' }"
- _plugin: dynaml
value:
pm_api_url: "https://<%= @dynaml[:proxmox][:host] %>/api2/json"
config:
_plugin: dynaml
merge:
file: custom.yaml
key: config
value:
ssh:
user: root
host-key-check: false
private-key: "<%= opts[:_boltdir] %>/private_key.pem"
Dependencies
- 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.