private Statement installModuleFromRemoteFileOrGit(String roleKey, Map<String, String> props) {
String moduleName = roleKey.substring(PUPPET.length() + 1).replaceAll("\\..*", "");
URI srcUri = URI.create(props.get(roleKey));
if ("git".equals(srcUri.getScheme())) {
return new InstallModuleFromGit(moduleName, srcUri, props.get(roleKey + ".branch"));
} else {
try {
String remotelyAccessibleUrl = prepareRemoteFileUrl.apply(srcUri.toASCIIString());
return call("install_tarball", remotelyAccessibleUrl, MODULES_DIR + moduleName);
} catch (IOException e) {