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

Rpm repo proxy support #808

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nameiner
Copy link

@nameiner nameiner commented Jun 11, 2024

What does this PR do?

This PR adds the ability to define a proxy server, proxy port, proxy username, and proxy password to be used by yum/dnf to connect to the DataDog yum repository via a proxy connection on RedHat Enterprise Linux and similar distributions.
Four new variables are introduced to capture the necessary data when the module is invoked from hiera or via class parameters. These parameters are validated before they are handed down to the yumrepo resource in the redhat.pp class.
A proxy can be used without specifying a user and password. But to use a proxy, both server and port are required.

Motivation

The module does currently not allow to manage the yum repository for installing the client if a proxy is needed to connect to it. I would like to use the functionality of being able to manage the repo configuration and be able to specify a proxy server to use.

Additional Notes

What does this PR do?
This PR adds functionality to provide a proxy server, proxy port, proxy username, and proxy password when using the functionality to manage the RPM repo on RHEL based systems. These parameters are validated before they are handed down to the yumrepo resource in the redhat.pp class.
The new class parameters introduced via this pull request are:
Optional[String] $rpm_repo_proxy_url = undef,
Optional[Integer] $rpm_repo_proxy_port = undef,
Optional[String] $rpm_repo_proxy_password = undef,
Optional[String] $rpm_repo_proxy_username = undef,
Documentation has been added in the class description.
Validation of parameter values has been added.

Describe your test plan

The branch with my changes was tested and is currently used in a production environment. The proxy and port are successfully configured in the /etc/yum.repos.d/datadog.repo file on the hosts and Puppet was able to install the datadog-agent RPM using the proxy. Since our environment does not use proxy users or passwords, I am not able to fully test this. But the parameters were handed to the yumrepo resource in the redhat.pp class during testing.
Without the parameters provided to the datadog module, the datadog-agent RPM could not be installed due to the restrictions in our environment. This is the expected behavior.

@nameiner nameiner requested a review from a team as a code owner June 11, 2024 17:40
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

Successfully merging this pull request may close these issues.

1 participant