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

Provide ability to override individual webhook settings #659

Open
adoom42 opened this issue Jun 20, 2024 · 0 comments
Open

Provide ability to override individual webhook settings #659

adoom42 opened this issue Jun 20, 2024 · 0 comments

Comments

@adoom42
Copy link

adoom42 commented Jun 20, 2024

I want to change the default_branch r10k setting in the webhook config. Because the class parameter is a hash, I have to provide a complete hash when calling the class, even when I only want to alter one value. This seems duplicative. It also increases the chance that I'll have to go back and manually update Hiera if the forge module adds, removes, or changes a parameter that I'm not concerned with.

From manifests/webhook.pp:

  R10k::Webhook::Config::R10k $r10k = {
    command_path    => '/opt/puppetlabs/puppet/bin/r10k',
    config_path     => '/etc/puppetlabs/r10k/r10k.yaml',
    default_branch  => 'production',
    prefix          => undef,
    allow_uppercase => false,
    verbose         => true,
    deploy_modules  => true,
    generate_types  => true,
  },

So instead of adding this to my Hiera config:

r10k::webhook::r10k:
  default_branch: 'mybranch'

I have to add this:

r10k::webhook::r10k:
  command_path: '/opt/puppetlabs/puppet/bin/r10k'
  config_path: '/etc/puppetlabs/r10k/r10k.yaml'
  default_branch: 'mybranch'
  prefix: undef
  allow_uppercase: false
  verbose: true
  deploy_modules: true
  generate_types: true

If I don't, those settings get excluded from the config file.

Am I missing something? Is there another way to do this cleanly? If not, please change the class parameters to be individual rather than grouping them into hashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant