Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(SUP-3709) - Indicator Exclusion using code manager and Hiera lookup #205

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -166,8 +166,21 @@ plan_hierarchy:
data_hash: yaml_data
```


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

#### Using Static Hiera data to populate indicator_exclusions when executing plans

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)

Create a [static.yaml] file in the environment layer hiera data directory```
```yaml
pe_status_check::indicator_exclusions:
- '<TEST ID>'
```

Indicator ID's within array will be excluded when `running pe_status_check::infra_summary` and `pe_status_check::agent_summary` p

#### Running the plans

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).
Expand Down
1 change: 1 addition & 0 deletions hiera.yaml
Expand Up @@ -23,3 +23,4 @@ hierarchy:
plan_hierarchy:
- name: "Static data"
path: "static.yaml"
data_hash: yaml_data
3 changes: 2 additions & 1 deletion plans/agent_summary.pp
Expand Up @@ -6,8 +6,9 @@
# Defaults to using a PuppetDB query to identify nodes
# @param indicator_exclusions
# List of disabled indicators, place any indicator ids you do not wish to report on in this list
# 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
plan pe_status_check::agent_summary(
Array[String[1]] $indicator_exclusions = [],
Array[String[1]] $indicator_exclusions = lookup('pe_status_check::indicator_exclusions', undef, undef, []),
Optional[TargetSpec] $targets = undef,
) {
# Query PuppetDB if $targets is not unspecified
Expand Down
3 changes: 2 additions & 1 deletion plans/infra_summary.pp
Expand Up @@ -6,8 +6,9 @@
# Defaults to using a PuppetDB query to identify nodes
# @param indicator_exclusions
# List of disabled indicators, place any indicator ids you do not wish to report on in this list
# 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
plan pe_status_check::infra_summary(
Array[String[1]] $indicator_exclusions = [],
Array[String[1]] $indicator_exclusions = lookup('pe_status_check::indicator_exclusions', undef, undef, []),
Optional[TargetSpec] $targets = undef,
) {
# Query PuppetDB if $targets is not unspecified
Expand Down