Add custom repositories snippet

the issue with `each_with_index` I had there in first version does not work in safe mode rendering (we whitelist some methods that are safe to use in provisioning templates)