beacon.present should merge configs, not overwrite them #67530
Replies: 6 comments
-
@dkfsalt There is a feature I added to develop which I think might accomplish what you were looking for. It allows you to specify a beacon_module in the configuration, eg.
This would allow you to include multiple instances of the inotify beacon each with a different name. I need to verify that it works when using beacon.present and properly document it. |
Beta Was this translation helpful? Give feedback.
-
@garethgreenaway - Nice one! I will give it a try in Apr (I'm currently on holiday :) |
Beta Was this translation helpful? Give feedback.
-
@dkfsalt Enjoy the holiday 😄 |
Beta Was this translation helpful? Give feedback.
-
Hi Gareth, I've finally had a chance to look at this (sorry for the delay) and I that's not quite what I was getting at. If you think about nearly all other state modules, the "present" methods adhere to the following patterns:
The current implementation of this functionality violates both of those patterns. Adding the "coalesce" and "beacon_type" properties doesn't help solve that issue. What it does is create a new edge-case parsing pattern that is non-intuitive and (IMHO) is likely to create another pattern that we must maintain downstream. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Beta Was this translation helpful? Give feedback.
-
Thank you for updating this issue. It is no longer marked as stale. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description of Issue/Question
Enhancement Request: Multiple State files that use beacon.present on the same type of beacon overwrite each other. Ideally, the two configs would merge together in the beacons.conf, rather than overwritting them.
This would give users greater flexibility in their ability to manage beacons on an application basis rather than globally (which increases the complexity of configuration and management of the beacons).
Setup
The ideal result of running these two states would be an /etc/salt/minion.d/beacons.conf which looks like:
Notice the difference in the "scope" of the "enable", "interval", "disable_during_state_run" parameters - in order to make this work, they would need to run on a per "files" definition basis and that pattern would need to be applied to other beacon types as well (like services).
Ideally, though, there would be a standard for beacon methods such that the states.beacon module simply calls the corresponding methods of the beacon module. So that all beacons have the following methods:
eg: beacon.present() would simply determine the type of module and call the corresponding present method of the beacon type (eg - "service.present()" or "inotify.present()".
Note: I suspect the impact of this would be far reaching for the minion itself, but I think that the current pattern for beacons is broken and causes unnecessary complexity for management.
Steps to Reproduce Issue
Put the two beacon.present configs into separate state files and apply them to a minion; the first config is overwritten by the second.
Versions Report
Master 2018.3.3, Minion 2018.3.4 / 2019.02
Beta Was this translation helpful? Give feedback.
All reactions