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

Add includepkgs to repo config #443

Merged
merged 1 commit into from
Jul 14, 2022
Merged

Add includepkgs to repo config #443

merged 1 commit into from
Jul 14, 2022

Conversation

sspans-sbp
Copy link
Contributor

The current repository configuration is unrestricted. Users / patch tooling running the standard yum update command will deploy the latest datadog agent. The recommended configuration of the role is to specify an explicit version, resulting in unfortunate upgrade/downgrade actions.

This PR adds the versioned package as includepkgs to the repository configuration.
This ensures that only the configured version can be installed by yum / dnf.

@sspans-sbp sspans-sbp requested a review from a team as a code owner June 29, 2022 09:39
@mx-psi
Copy link
Member

mx-psi commented Jun 29, 2022

Hey @sspans-sbp thanks for your contribution, could you make sure the CI tests pass? It seems like they are failing on downgrades

@sspans-sbp
Copy link
Contributor Author

Includepkgs doesn't use the epoch for matching, I've added a jinja filter to strip it from the version string.

@sspans-sbp
Copy link
Contributor Author

It seems this feature is also supported by zypper, so it makes sense to add it for SuSE as well.

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I want @bkabrda to have a look too

@mx-psi mx-psi requested a review from bkabrda June 30, 2022 09:34
@sspans-sbp
Copy link
Contributor Author

Any progress on the review?

@mx-psi
Copy link
Member

mx-psi commented Jul 6, 2022

Any progress on the review?

Hey, my teammate is out of office, so you will have to wait a few more days until he is back (I will remind him, no worries :))

Copy link
Contributor

@bkabrda bkabrda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening the PR. Overall I think this is a good thing to do, however as noted inline, I can't get the SUSE part to work (I don't think this actually works with zypper). Once we get that sorted out, I can merge.

templates/zypper.repo.j2 Outdated Show resolved Hide resolved
@sspans-sbp
Copy link
Contributor Author

I've removed the SuSE bits, please review.

Copy link
Contributor

@bkabrda bkabrda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merging. Thanks for the PR!

@bkabrda bkabrda merged commit f6dca2a into DataDog:main Jul 14, 2022
@bkabrda
Copy link
Contributor

bkabrda commented Jul 14, 2022

As a side note, for a while I was deliberating about the fact that some people might actually expect to be able to do plain yum update after running the playbook and get the latest version. I think the reasoning in the description of this PR is valid and its pros (ensuring that the agent flavor/version are always as configured) far outweigh the potential downside, especially considering Ansible's design goal of ensuring that the target machine is put to a certain state.

That said, this new behavior should be documented clearly and explicitly in the release notes for the next release so that users are well informed of its consequences.

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.

3 participants