You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/configuration-hiera.md
+20-4Lines changed: 20 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,22 @@
1
1
# Configuring octocatalog-diff to use Hiera
2
2
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.)
4
20
5
21
Before you start, please understand how octocatalog-diff compiles a catalog:
6
22
@@ -10,7 +26,7 @@ Before you start, please understand how octocatalog-diff compiles a catalog:
10
26
- It compiles the catalog, based on the temporary directory, for environment=production
11
27
- It removes the temporary directory
12
28
13
-
## Configuring the location of hiera.yaml
29
+
###Configuring the location of hiera.yaml
14
30
15
31
The command line option `--hiera-config PATH` allows you to set the path to hiera.yaml.
16
32
@@ -65,7 +81,7 @@ You may specify this as either an absolute or a relative path.
65
81
66
82
We strongly recommend that you version-control your hiera.yaml file within your Puppet repository, and use the relative path option described above.
67
83
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
69
85
70
86
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.
71
87
@@ -88,7 +104,7 @@ If you are specifying the Hiera data path in the [configuration file](/doc/confi
88
104
89
105
octocatalog-diff will fail if you specify a path that is not a directory.
90
106
91
-
## Configuring the prefix path to strip
107
+
### Configuring the prefix path to strip
92
108
93
109
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.
0 commit comments