-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Bulk updates requires a lot of studdering #14
Comments
That could be interesting indeed. Do you want to provide a PR with such a |
I would but... sadly I don't think I know enough Ruby to add a function that does that. If I did it as a define() then it wouldn't have the performance benefit. |
I was actually thinking of a DSL define. How would you expect to see performance benefit? |
On the performance issue: since puppet 3.4, augeasproviders use a shared Augeas handler for all resources. Hence, Augeas is only started once, and only parses target files twice as most (one read to fill the tree, a second read to calculate the diff if changes were made, and one write to flush changes if any). All you need is to use puppet 3.4+. The only overhead to using separate resources currently is stuff done entirely in memory, so the gain wouldn't be great. |
Oh, so the optimization is already in there. That's awesome! I'll see if I can work up a DSL define. |
Actually, the lib still saves the Augeas tree once per modified resource (vs once per modified property). I don't think it would be good to change this though, as that would mean that if a resource produces an invalid tree, all resources of that file will fail to apply. |
Problem: If one has to set a lot of variables in many files (for example, using each()), you have to repeat yourself a lot.
For example, this is the cleanest I've been able to write for setting many variables.
There are a few problems with this:
variable =>
andvalue =>
again and again is very verbose. It hides meaning.Proposed Solution: For mass updates, it would be more natural to have a function that takes a filename and a list of settings:
The text was updated successfully, but these errors were encountered: