-
Notifications
You must be signed in to change notification settings - Fork 142
feat: add macOS support to alloy role #418
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
Conversation
**Added:** - Introduced macOS (Darwin) support for installing and managing Alloy, including a dedicated `setup-Darwin.yml` task file leveraging Homebrew for package management and service control - Added macOS-specific handler to restart Alloy using Homebrew services - Defined Darwin-specific variables in `vars/Darwin.yml` for Homebrew tap, package, and default config path - Updated role metadata to declare macOS platform support **Changed:** - Updated documentation to mention macOS as a supported OS and specify Homebrew and `community.general` requirements - Modified deployment tasks to conditionally execute Linux-specific logic only on RedHat and Debian families, and add macOS-specific verification and setup - Adjusted handler logic to include macOS restart handler - Improved uninstall logic to stop Alloy and remove config on macOS, and uninstall via Homebrew when appropriate
|
Thanks for contributing and adding macOS support! I'm not a macOS user myself, so I can’t fully test it, but I did take the time to review your PR. From my perspective, it’s safe to merge since it doesn’t affect Before we merge, could you please update |
**Changed:** - Updated all Ansible register and fact variable names in the Alloy macOS setup task to use a double underscore prefix for consistency and to avoid naming conflicts - Changed the default value for `__alloy_config_path_default` to reference `__brew_prefix.stdout` instead of `brew_prefix.stdout` in Darwin-specific variables for consistency with task variable naming - Refactored logic throughout the Alloy Darwin setup to use the new variable names in all conditions, paths, and debug statements for clarity and maintainability
Sure thing, done! |
If it helps, here's the relevant snippet from the playbook I use: and the output from running it: |
Of course! I started to write it into one of my collections and quickly realized there was probably an existing collection that I could update instead. |
**Changed:** - Consolidated Alloy service start tasks into a single step, removing redundant sudo logic and user-level distinction to streamline service management - Updated service start and restart steps to use explicit return code checks for failure detection, improving error handling consistency - Simplified conditional logic to reduce complexity in service start and restart operations on Darwin systems **Removed:** - Eliminated separate sudo-based service start task and related conditionals to avoid unnecessary privilege escalation and duplication
Added:
setup-Darwin.ymltask file leveraging Homebrew for package management and service control (as per https://grafana.com/docs/alloy/latest/set-up/install/macos/)vars/Darwin.ymlfor Homebrew tap, package, and default config pathChanged:
community.generalrequirements