Welcome to Ansible hieradata documentation!

Ansible Hieradata

This collection provides plugins to manage your project configuration data in a hierarchical manner like puppet do.

Installation

The collection is available via Ansible Galaxy. So you can run

ansible-galaxy collection install codeaffen.hieradata

Alternatively you can build and install the collection from source.

make dist
ansible-galaxy collection install codeaffen-hieradata-<version>.tar.gz

Configuraton

vars plugin configuration

The plugin comes with useful defaults to start to use the hieradata vars plugin without any configuration.

But if you need to customize the configuration you can see in documentation you can configure the vars plugin eigther via ansible.cfg parameter in section hieradata or via environment variables.

You have to keep in mind that the paths for basedir and config are relative to your inventory directory. Without any configuration you have to place the basedir and config as followed.

.
├── ansible.cfg
├── hieradata
├── hieradata.yml
└── hosts

If you want to use a different base then hieradata you can override it by exporting HIERADATA_BASE_DIR environment variable. This directory also has to belongs to inventory dirctory.

.
├── ansible.cfg
└── inventory
    ├── hieradata
    │   └── customer_a
    ├── hieradata.yml
    └── hosts

In this example you need to do export HIERADATA_BASE_DIR=hieradata/customer_a if you want to use hieradata/customer_a as hiera basedir.

Documentation

readthedocs.io

Current documentation can be found on readthedocs.io.

repository folder

A last option to read the docs is the docs folder in this repository.

Dependencies

The following dependencies have to be fulfiled by the Ansible controller.

codeaffen.hieradata Release Notes

v0.1.0

Minor Changes

  • Add a wrapper function combine_vars to be compatible to default ansible.

  • Add configuration parameters to manage hash and list behavior.

  • Add method to parse configuration file (e.g. hieradata.yml).

  • After loading, the vars will be combined with ansible functions.

  • Change parameter names. Remove prefix to make documentation more clear.

  • If last part is directory it can have no, one or multiple files in it.

  • Last part of hierarchy can be file or directory.

  • Load files from hierarchy.

  • Parse entity name into hiera_vars dict.

  • The hiera_vars dict can be used to generate a dynamic hierarchy.

  • These function tages two extra parameters hash_behavior and list_behavior to configure this feature as needed.

v0.0.1

New Plugins

Vars
  • codeaffen.hieradata.hieradata - Loads configuration from a hierarchical configuration structure structure

Plugin Index

These are the plugins in the codeaffen.hieradata collection

Vars Plugins

  • hieradata – Loads configuration from a hierarchical configuration structure

See also

List of collections with docs hosted here.

Filters

Filters are used to manipulate data if needed.

<filter_name>

<!– Filter description –>

since version: <SemVer_string>

<!-- example code -->

How to contribute to ansible-hiera-data

Did you found a bug

  • Make sure the bug is not already opened by another user.

  • If you can’t find an open issue which reflects your observed problem go ahead an open a new bug.

  • Provide as much information as mentioned in the bug report template.

Did you wrote a patch for an open bug

  • Open new pull request containing the patch.

  • Provide a clear description which describes the problem and the solution. Link the existing bug to the PR.

Do you want to add a new feature

  • Make sure there isn’t already a feature request.

  • If you can’t find an open feature request which describe your feature idea or parts of it feel free to open a new feature request.

  • Suggest your feature idea within the created feature request.

  • Provide as much discribtion as possible to enable others to have a good understanding of what you are doing.

  • Point out that you want to start to work on the new feature

Do you wnat to contribute to documentation

  • Write you documentation change.

  • Open a PR with your change.

  • Discuss with the team about your changes.

Thank you for any contribution

We will thank you for heed the contribution guidelines and we encourage you to contribute and join the team.

Indices and tables