Re-own .bundle Directories on Servers#66833
Merged
Merged
Conversation
.bundle Directories on Servers
sureshc
approved these changes
Jul 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, all of our persistent managed servers will generate
.bundlesubdirectories owned by the root user within thecookbooksanddashboarddirectories as a side effect of the CI build:This behavior also manifests on adhocs, although the cookbooks subdir will only show up after a second full build following the first initial build.
Currently, this behavior is messy but not technically problematic, since we do indeed execute (most) of our
bundle installoperations as the root user. That is bad practice, however, and particularly with the removal of the "auto-sudo" feature in bundler v2.4 we intend to start executing ourbundle installs as the ubuntu user.In preparation for that, this PR adds some logic to chef which will re-own those directories appropriately.
Testing story
To verify both that this change will apply cleanly to our existing persistent managed servers and that it will enable the desired switch, I followed this process:
ci_buildafter the adhoc has successfully spun up, which will create the root-owned.bundledirectories as a side effectsudo chef-client -o cdo-appsfrom/var/chefto execute the changes, then trigger another build withstart-buildand verify that it succeeds.Follow-up work
Once this change has propagated to all appropriate servers, we can safely merge #66536
Note that because of the order in which we execute things during a CI build, we specifically need for a
chef-clientrun which executes this change to fully complete on the server before a CI build including the next change can begin.