Skip to content

Commit 98ddb62

Browse files
committed
Update documentation
1 parent 214c440 commit 98ddb62

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

doc/configuration-hiera.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# Configuring octocatalog-diff to use Hiera
22

3-
If you are using Hiera with Puppet, then you must already have a [`hiera.yaml`](https://docs.puppet.com/puppet/latest/reference/config_file_hiera.html) file to configure it. These instructions will guide you through pointing octocatalog-diff at that configuration file.
3+
## Hiera 5 with per-environment configuration only
4+
5+
Hiera 5 can recognize and use `hiera.yaml` file in the base directory of the environment. There is more information about this in Puppet's documentation:
6+
7+
- [Enable the environment layer for existing Hiera data](https://puppet.com/docs/puppet/5.3/hiera_migrate_environments.html)
8+
9+
There is no special configuration for octocatalog-diff needed to make this work. If you have no global hiera configuration, make sure that you are *not* using any of the following command line options or [configuration settings](/doc/configuration.md):
10+
11+
- `--hiera-path` or `settings[:hiera_path]`
12+
- `--hiera-path-strip` or `settings[:hiera_path_strip]`
13+
- `--hiera-config` or `settings[:hiera_config]`
14+
15+
## Hiera 3 or before, or Hiera 5 with global configuration
16+
17+
If you are using Hiera 5 with a global configuration, or you are using Hiera 3 or before, then you must already have a [`hiera.yaml`](https://docs.puppet.com/puppet/latest/reference/config_file_hiera.html) file to configure it. These instructions will guide you through pointing octocatalog-diff at that configuration file.
18+
19+
octocatalog-diff will automatically determine whether your Hiera configuration file is used for Hiera 5 or Hiera 3 or before, and treat it accordingly. (Hiera 5 configurations files are identified as such by a `version: 5` line in the file itself.)
420

521
Before you start, please understand how octocatalog-diff compiles a catalog:
622

@@ -10,7 +26,7 @@ Before you start, please understand how octocatalog-diff compiles a catalog:
1026
- It compiles the catalog, based on the temporary directory, for environment=production
1127
- It removes the temporary directory
1228

13-
## Configuring the location of hiera.yaml
29+
### Configuring the location of hiera.yaml
1430

1531
The command line option `--hiera-config PATH` allows you to set the path to hiera.yaml.
1632

@@ -65,7 +81,7 @@ You may specify this as either an absolute or a relative path.
6581
6682
We strongly recommend that you version-control your hiera.yaml file within your Puppet repository, and use the relative path option described above.
6783
68-
## Configuring the directory in your repository in which hiera data files are found
84+
### Configuring the directory in your repository in which hiera data files are found
6985
7086
The command line option `--hiera-path PATH` allows you to set the directory path, relative to the checkout of your Puppet repository, of your Hiera YAML/JSON data files.
7187
@@ -88,7 +104,7 @@ If you are specifying the Hiera data path in the [configuration file](/doc/confi
88104
89105
octocatalog-diff will fail if you specify a path that is not a directory.
90106
91-
## Configuring the prefix path to strip
107+
### Configuring the prefix path to strip
92108
93109
This is a different, and potentially more complex, alternative to `--hiera-path` / `settings[:hiera_path]` described in the prior section. Unless you have a very good reason, you should prefer to use the instructions above.
94110

0 commit comments

Comments
 (0)