feat(homebrew): add Homebrew tap update management#4
Merged
Conversation
- Introduced `manage_update` parameter to control Homebrew tap updates. - Added `homebrew::update` class to handle periodic updates with a configurable frequency. - Updated README with instructions on enabling and configuring tap updates. - Ensured transient failures during updates are retried without affecting the update interval.
There was a problem hiding this comment.
Pull request overview
This PR adds opt-in management of brew update runs for Homebrew taps by introducing a manage_update toggle and an update interval, with accompanying documentation and an example manifest.
Changes:
- Added
manage_updateandupdate_frequencyparameters to the mainhomebrewclass to control periodic updates. - Introduced
homebrew::updateto runbrew updateat most once per configured interval using a timestamp marker. - Documented the behavior and ordering guidance in
README.rst, plus added atests/update.ppexample.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
manifests/init.pp |
Adds new parameters and conditionally declares/contains homebrew::update. |
manifests/update.pp |
Implements the periodic brew update exec guarded by a timestamp marker. |
README.rst |
Documents the new opt-in update mechanism, marker behavior, and ordering. |
tests/update.pp |
Adds an example manifest showing how to enable and configure updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+8
to
10
| Boolean $manage_update = false, | ||
| Integer $update_frequency = 86400, | ||
| Hash[String, String] $homebrew_environment = {}, |
Comment on lines
+12
to
+14
| # $update_frequency is expressed in seconds; find -mmin works in minutes. | ||
| $frequency_minutes = $homebrew::update_frequency / 60 | ||
|
|
Comment on lines
+19
to
+24
| exec { 'homebrew-update': | ||
| command => "/usr/bin/su ${homebrew::user} -c '${brew} update' && /usr/bin/touch ${marker}", | ||
| unless => "/usr/bin/find ${marker} -mmin -${frequency_minutes} | /usr/bin/grep -q .", | ||
| logoutput => on_failure, | ||
| timeout => 0, | ||
| } |
…cution - Changed the type of `update_frequency` to enforce a minimum value of 60 minutes. - Simplified the architecture-dependent Homebrew prefix assignment in `homebrew::update` by reusing the value from `homebrew::install`. - Updated the command execution logic in the `homebrew-update` exec resource to handle transient failures more gracefully and increased the timeout to 300 seconds.
overag3
added a commit
that referenced
this pull request
Jul 7, 2026
feat(homebrew): add Homebrew tap update management
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.
manage_updateparameter to control Homebrew tap updates.homebrew::updateclass to handle periodic updates with a configurable frequency.