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
+29-10Lines changed: 29 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,28 @@
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
4
+
5
+
Hiera 5 is included with Puppet 4.9 and higher.
6
+
7
+
If there is a `hiera.yaml` file in the base directory of the environment that is in hiera 5 format, and you are running Puppet 4.9 or higher, then that file will be recognized by Puppet (and therefore, by octocatalog-diff). There is no special configuration for octocatalog-diff needed to make this work. Similarly, there is no command line option or setting to changed this behavior, because there is no corresponding option to change Puppet's behavior.
8
+
9
+
If you are running Puppet 4.8 or lower, then the `hiera.yaml` file in the base directory of the environment will be ignored (unless you use `--hiera-config` to specify it as your global configuration file).
10
+
11
+
If you have no global hiera configuration and you wish to rely on a `hiera.yaml` file in the base directory of your environment, make sure that you are *not* using any of the following command line options or [configuration settings](/doc/configuration.md):
12
+
13
+
-`--hiera-path` or `settings[:hiera_path]`
14
+
-`--hiera-path-strip` or `settings[:hiera_path_strip]`
15
+
-`--hiera-config` or `settings[:hiera_config]`
16
+
17
+
There is more information about Hiera 5 in Puppet's documentation:
18
+
19
+
-[Enable the environment layer for existing Hiera data](https://puppet.com/docs/puppet/5.3/hiera_migrate_environments.html)
20
+
21
+
## Hiera global configuration
22
+
23
+
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.
24
+
25
+
octocatalog-diff will automatically determine the version of your Hiera configuration file and treat it accordingly. (Hiera 5 configuration files are identified as such by a `version: 5` line in the file itself.)
4
26
5
27
Before you start, please understand how octocatalog-diff compiles a catalog:
6
28
@@ -10,9 +32,9 @@ Before you start, please understand how octocatalog-diff compiles a catalog:
10
32
- It compiles the catalog, based on the temporary directory, for environment=production
11
33
- It removes the temporary directory
12
34
13
-
## Configuring the location of hiera.yaml
35
+
###Configuring the location of global hiera.yaml
14
36
15
-
The command line option `--hiera-config PATH` allows you to set the path to hiera.yaml.
37
+
The command line option `--hiera-config PATH` allows you to set the path to the global hiera.yaml.
16
38
17
39
You may specify this as either an absolute or a relative path.
18
40
@@ -24,12 +46,9 @@ You may specify this as either an absolute or a relative path.
The path is relative to a checkout of your Puppet repository. With the setting above, it will use the file named `hiera.yaml` that is at the top level
28
-
of your Puppet checkout.
49
+
The path is relative to a checkout of your Puppet repository. With the setting above, it will use the file named `hiera.yaml` that is at the top level of your Puppet checkout.
29
50
30
-
Perhaps your hiera.yaml file is in a subdirectory of your Puppet checkout. In that case, just use the relative directory path. Be sure not to add a leading `/` though,
31
-
because you don't want octocatalog-diff to treat it as an absolute path. In the following example, suppose you have a top level directory called `config` and your
32
-
`hiera.yaml` file is contained within it. You could then use:
51
+
Perhaps your hiera.yaml file is in a subdirectory of your Puppet checkout. In that case, just use the relative directory path. Be sure not to add a leading `/` though, because you don't want octocatalog-diff to treat it as an absolute path. In the following example, suppose you have a top level directory called `config` and your `hiera.yaml` file is contained within it. You could then use:
@@ -65,7 +84,7 @@ You may specify this as either an absolute or a relative path.
65
84
66
85
We strongly recommend that you version-control your hiera.yaml file within your Puppet repository, and use the relative path option described above.
67
86
68
-
## Configuring the directory in your repository in which hiera data files are found
87
+
### Configuring the directory in your repository in which hiera data files are found
69
88
70
89
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
90
@@ -88,7 +107,7 @@ If you are specifying the Hiera data path in the [configuration file](/doc/confi
88
107
89
108
octocatalog-diff will fail if you specify a path that is not a directory.
90
109
91
-
## Configuring the prefix path to strip
110
+
### Configuring the prefix path to strip
92
111
93
112
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.
Full or relative path to global Hiera configuration file for the from branch
659
+
</td>
660
+
<td valign=top>
661
+
Specify a relative path to the Hiera yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_config.rb">hiera_config.rb</a>)
662
+
</td>
663
+
</tr>
664
+
665
+
<tr>
666
+
<td valign=top>
667
+
<pre><code>--from-hiera-path STRING</code></pre>
668
+
</td>
669
+
<td valign=top>
670
+
Path to hiera data directory, relative to top directory of repository for the from branch
671
+
</td>
672
+
<td valign=top>
673
+
Specify the path to the Hiera data directory (relative to the top level Puppet checkout). For Puppet Enterprise and the
674
+
Puppet control repo template, the value of this should be 'hieradata', which is the default. (<ahref="../lib/octocatalog-diff/cli/options/hiera_path.rb">hiera_path.rb</a>)
Path prefix to strip when munging hiera.yaml for the from branch
684
+
</td>
685
+
<td valign=top>
686
+
Specify the path to strip off the datadir to munge hiera.yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_path_strip.rb">hiera_path_strip.rb</a>)
@@ -773,10 +817,10 @@ This timeout is specified in seconds. (<a href="../lib/octocatalog-diff/cli/opti
773
817
774
818
<tr>
775
819
<td valign=top>
776
-
<pre><code>--hiera-config PATH</code></pre>
820
+
<pre><code>--hiera-config STRING</code></pre>
777
821
</td>
778
822
<td valign=top>
779
-
Relative path to hiera YAML file
823
+
Full or relative path to global Hiera configuration file globally
780
824
</td>
781
825
<td valign=top>
782
826
Specify a relative path to the Hiera yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_config.rb">hiera_config.rb</a>)
@@ -785,10 +829,10 @@ This timeout is specified in seconds. (<a href="../lib/octocatalog-diff/cli/opti
785
829
786
830
<tr>
787
831
<td valign=top>
788
-
<pre><code>--hiera-path PATH</code></pre>
832
+
<pre><code>--hiera-path STRING</code></pre>
789
833
</td>
790
834
<td valign=top>
791
-
Path to hiera data directory, relative to top directory of repository
835
+
Path to hiera data directory, relative to top directory of repository globally
792
836
</td>
793
837
<td valign=top>
794
838
Specify the path to the Hiera data directory (relative to the top level Puppet checkout). For Puppet Enterprise and the
@@ -798,10 +842,10 @@ Puppet control repo template, the value of this should be 'hieradata', which is
798
842
799
843
<tr>
800
844
<td valign=top>
801
-
<pre><code>--hiera-path-strip PATH</code></pre>
845
+
<pre><code>--hiera-path-strip STRING</code></pre>
802
846
</td>
803
847
<td valign=top>
804
-
Path prefix to strip when munging hiera.yaml
848
+
Path prefix to strip when munging hiera.yaml globally
805
849
</td>
806
850
<td valign=top>
807
851
Specify the path to strip off the datadir to munge hiera.yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_path_strip.rb">hiera_path_strip.rb</a>)
@@ -1541,6 +1585,43 @@ by permitting a data type specification as well. (<a href="../lib/octocatalog-di
1541
1585
</td>
1542
1586
</tr>
1543
1587
1588
+
<tr>
1589
+
<td valign=top>
1590
+
<pre><code>--to-hiera-config STRING</code></pre>
1591
+
</td>
1592
+
<td valign=top>
1593
+
Full or relative path to global Hiera configuration file for the to branch
1594
+
</td>
1595
+
<td valign=top>
1596
+
Specify a relative path to the Hiera yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_config.rb">hiera_config.rb</a>)
1597
+
</td>
1598
+
</tr>
1599
+
1600
+
<tr>
1601
+
<td valign=top>
1602
+
<pre><code>--to-hiera-path STRING</code></pre>
1603
+
</td>
1604
+
<td valign=top>
1605
+
Path to hiera data directory, relative to top directory of repository for the to branch
1606
+
</td>
1607
+
<td valign=top>
1608
+
Specify the path to the Hiera data directory (relative to the top level Puppet checkout). For Puppet Enterprise and the
1609
+
Puppet control repo template, the value of this should be 'hieradata', which is the default. (<ahref="../lib/octocatalog-diff/cli/options/hiera_path.rb">hiera_path.rb</a>)
Path prefix to strip when munging hiera.yaml for the to branch
1619
+
</td>
1620
+
<td valign=top>
1621
+
Specify the path to strip off the datadir to munge hiera.yaml file (<a href="../lib/octocatalog-diff/cli/options/hiera_path_strip.rb">hiera_path_strip.rb</a>)
0 commit comments