Skip to content

[Feature request]: Option to disable updating storeconfigs #16

@kjetilho

Description

@kjetilho

Use Case

We spin up review environments for changes in merge requests, but when these are tested on actual servers, even in --noop mode, they will update PuppetDB. This can add or break alerting or even backup configuration. We have currently disabled storeconfigs for these environments, but then the catalog will not include collected resources from PuppetDB in the test run, which gives a misleading result from the test run.

Describe the solution you would like

It would be useful if there was an additional parameter to make storeconfig read-only, e.g., storeconfig_update = false (with the default being true)

For me such an on/off switch is fine, since I run every environment in a separate container. For many people, it would be useful to specify behaviour per environment. One possible interface would be to allow either a boolean or a regular expression. To ease "naïve" usage, the regexp could have implicit anchors, so that "production" would match production exactly, and all other environment names would not update PuppetDB. another option would be to use the same matching as for node declarations, ie., put it in // to interpret it as a regular expression.

Describe alternatives you've considered

A related issue is that --noop is not taken into account by the puppetserver. The information is available in the clientnoop fact, so it is possible to wrap all @@ resources inside if ! fact('clientnoop') { }, but it is fragile, and it would still clear out existing exported resources.

IMHO it would be a reasonable default if the storeconfig_update suggested above was false when clientnoop is set.

[addendum] Ben Ford suggested that this setting could be set in the per environment file environment.conf instead. This may be a better solution than a regexp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions