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 'maxadamo-hiera_redis', '0.3.5'
Learn more about managing modules with a PuppetfileDocumentation
hiera_redis
Table of Contents
- Description
- Setup - The basics of getting started with hiera_redis
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
This module provides a Hiera 5 backend for Redis.
Setup
Setup Requirements
The backend requires the redis gem installed in the Puppet Server JRuby. It can be installed with:
/opt/puppetlabs/bin/puppetserver gem install redis
It is also recommended to install the gem into the agent's Ruby:
/opt/puppetlabs/puppet/bin/gem install redis
This allows commands such as puppet apply
or puppet lookup
to use the backend.
Beginning with hiera_redis
If Redis is running on the Puppet master with the default settings, specifying the lookup_key
as 'redis_lookup_key' is sufficient, for example
---
version: 5
hierarchy:
- name: hiera_redis
lookup_key: redis_lookup_key
Usage
By default, the backend will query Redis with the key provided.
It is also possible to query multiple scopes such as with the YAML backend, where the expected key in Redis is composed of the scope and the key separated by a character (default is :
). For example, the following can be used:
---
version: 5
hierarchy:
- name: hiera_redis
lookup_key: redis_lookup_key
options:
confine_to_keys:
- '^redis_.*'
- '^myapp_.*'
- '^ssh_group$'
scopes:
- "osfamily/%{facts.os.family}"
- common
The backend then expects keys of a format such as common:foo::bar
for a lookup of 'foo::bar'.
The other options available include:
host
: The host that Redis is located on. Defaults to 'localhost'.port
: The port that Redis is running on. Defaults to 6379.socket
: Optional Unix socket pathpassword
: Optional Redis passworddb
: The database number to query on the Redis instance. Defaults to 0.scope
: The scope to use when querying the database.scopes
: An array of scopes to query. Cannot be used in conjunction with thescope
option.separator
: The character separator between the scope and key being queried. Defaults to ':'.confine_to_keys
: Only use this backend if the key matches one of the regexes in the array:
confine_to_keys:
- "application.*"
- "apache::.*"
Limitations
This module has only been tested on CentOS.
Development
PRs welcome.