Skip to content

Misleading/unnecessary warning on pe-puppetserver startup #48

@bastelfreak

Description

@bastelfreak

Describe the Bug

On PE 2019, PE 2021 and probably PE2023 we get the following warning when code-manager is active but no r10k private key is set:

2024-07-28T13:54:42.124Z WARN  [async-dispatch-2] [p.c.config] No default private key provided. Code Manager will not be able to access most git repositories over ssh. Please set 'puppetlabs.code-manager.git.private-key'
2024-07-28T13:54:42.125Z WARN  [async-dispatch-2] [p.c.config] No default private key provided. Code Manager will not be able to access most git repositories over ssh. Please set 'puppetlabs.code-manager.git.private-key'

This is a bit misleading when you've only http(s) control repositories configured. In that case the private key isn't required at all. The warning is problematic because multiple customers analyse their logfiles and they match on ERR and WARN.

Expected Behavior

Above log message should only happend when:

  • code manager is enabled
  • a repository is configured that's used via ssh
  • no private key is is configured

As an alternative, only support ssh access when a private key is set.

Steps to Reproduce

set

"puppet_enterprise::profile::master::code_manager_auto_configure": true,
"puppet_enterprise::profile::master::r10k_remote": "https://github.com/bastelfreak/testcontrolrepo",

run puppet agent -t
restart pe-puppetserver

Environment

  • PE 2019.8.12
  • PE 2021.7.8

Additional Context

I would have submitted a patch but the PE license prohibits sharing patches, the repo is private and #10 isn't resolved yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions