-
Notifications
You must be signed in to change notification settings - Fork 140
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
validate the config in fb_apache #160
Comments
@davide125 A default approach to perform such a validation is to use One can only do a non-trivial, potentially error prone, and brittle implementation which is something that may not be worth doing. We'd be happy to review PRs but not something that we'd implement. Feel free to DM me and I can provide some internal context as well. |
@gogsbread - Just for context, Davide is one of your co-workers (he's on the kernel team), and was on the OS Team that wrote these cookbooks (before the OS Team was disbanded in the recent re-org). And yeah, it's harder with Apache than some others for the reason you describe. This is why we made a task for it rather than doing it (if it was easy we would have made the one-line diff :) ). However the complete lack of any verification has caused a lot of problems thus far. At Facebook the yum origin servers went down. At SCALE the website went down. So it's painful. We didn't have a great solution off hand, so we just created this as a placeholder. That said, we added none of that context to this task, which I'm sure I'll get a (justified) earful from @NaomiReeves on, and which caused you to trip on this. So I think at this point this has enough context to leave open for one of us one day when we feel like digging into a fun problem. But if you prefer to modify the Issue itself, and then delete these comments, that's also fine. |
@jaymzh thank you for the context. These comments and discussion and useful and we'll continue to have this documented. In summary, there are two high level approaches I could think of and worth documenting:
For 1. @NaomiReeves had some discussions with chef dev
For 2. I tried to provide a rough implementation, however I couldn't find an easy way currently to access the path where the file was backed-up. |
The backup directory is easy to find, it's in the config object, but I definitely would not go that route. What I'd do is something akin to a custom resource in which you...
Then you're not reaching into the backup directory or ever fucking with live configs if they don't work. This is similar, but much less complicated, than when I do in fb_network_scripts or whatever it's called these days. Don't feel obligated to do this, not sure what Naomi has you on, but if you're interested and want to do this, I can definitely review it. |
No obligation; I was just toying around with different ideas and learning chef in the process. |
I left some comments for ya. Thanks for the heads up! |
We should run
httpd -t
in a validator when rendering config files in templatesThe text was updated successfully, but these errors were encountered: