This is already a work-in-progress, with the related commits showing up here:
Since "refactor" is sort of endless and abstract as a task goal, here's some of the objectives we're going after here (may evolve as the factoring does, to some degree):
- Adhere to our puppet style conventions as much as reaosonably possible
- Eliminate $::realm and $::site conditional code through hieraization
- De-duplicate role::cache::$foo code into base/1layer/2layer as appropriate
- Create new module to sit between role::cache::$foo and the various software-specific modules like varnish, nginx, etc
- Move WMF-specific VCL from modules/varnish + templates/varnish to new module
- De-duplicate shared VCL between clusters (especially text + mobile), align current slight variations where appropriate