Skip to content

Commit c5a77d5

Browse files
Exclusion Work for indicator_exclusions using hiera
1 parent 4f94f46 commit c5a77d5

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,21 @@ plan_hierarchy:
166166
data_hash: yaml_data
167167
```
168168

169+
169170
See the following [documentation](https://puppet.com/docs/bolt/latest/hiera.html#outside-apply-blocks) for further explanation.
170171

172+
#### Using Static Hiera data to populate indicator_exclusions when executing plans
173+
174+
Place the plan_hierarchy listed in the step above, in the environment layer (https://www.puppet.com/docs/pe/latest/writing_plans_in_puppet_language_pe.html#using_hiera_with_plans)
175+
176+
Create a [static.yaml] file in the environment layer hiera data directory```
177+
```yaml
178+
pe_status_check::indicator_exclusions:
179+
- '<TEST ID>'
180+
```
181+
182+
Indicator ID's within array will be excluded when `running pe_status_check::infra_summary` and `pe_status_check::agent_summary` p
183+
171184
#### Running the plans
172185

173186
The `pe_status_check::infra_summary` and `pe_status_check::agent_summary` plans can be run from the [PE console](https://puppet.com/docs/pe/latest/running_plans_from_the_console_.html) or from [the command line](https://puppet.com/docs/pe/latest/running_plans_from_the_command_line.html). Below are some examples of running the plans from the command line. More information on the parameters in the plan can be seen in the [REFERENCE.md](REFERENCE.md).

hiera.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ hierarchy:
2323
plan_hierarchy:
2424
- name: "Static data"
2525
path: "static.yaml"
26+
data_hash: yaml_data

plans/agent_summary.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
# Defaults to using a PuppetDB query to identify nodes
77
# @param indicator_exclusions
88
# List of disabled indicators, place any indicator ids you do not wish to report on in this list
9+
# Static Hiera Data can be used to set indicator_exclusions in a plan - for more information see https://www.puppet.com/docs/pe/latest/writing_plans_in_puppet_language_pe.html#using_hiera_with_plans
910
plan pe_status_check::agent_summary(
10-
Array[String[1]] $indicator_exclusions = [],
11+
Array[String[1]] $indicator_exclusions = lookup('pe_status_check::indicator_exclusions', undef, undef, []),
1112
Optional[TargetSpec] $targets = undef,
1213
) {
1314
# Query PuppetDB if $targets is not unspecified

plans/infra_summary.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
# Defaults to using a PuppetDB query to identify nodes
77
# @param indicator_exclusions
88
# List of disabled indicators, place any indicator ids you do not wish to report on in this list
9+
# Static Hiera Data can be used to set indicator_exclusions in a plan - for more information see https://www.puppet.com/docs/pe/latest/writing_plans_in_puppet_language_pe.html#using_hiera_with_plans
910
plan pe_status_check::infra_summary(
10-
Array[String[1]] $indicator_exclusions = [],
11+
Array[String[1]] $indicator_exclusions = lookup('pe_status_check::indicator_exclusions', undef, undef, []),
1112
Optional[TargetSpec] $targets = undef,
1213
) {
1314
# Query PuppetDB if $targets is not unspecified

0 commit comments

Comments
 (0)