class FreeIpaConfigService {

    public FreeIpaConfigView createFreeIpaConfigs(Stack stack, Set<Node> hosts, ProxyConfig proxyConfig) {
        final FreeIpaConfigView.Builder builder = new FreeIpaConfigView.Builder();

        FreeIpa freeIpa = freeIpaService.findByStack(stack);
        Map<String, String> subnetWithCidr = networkService.getFilteredSubnetWithCidr(stack);
        String reverseZones = reverseDnsZoneCalculator.reverseDnsZoneForCidrs(subnetWithCidr.values());

        return builder
                .withRealm(freeIpa.getDomain().toUpperCase())
                .withDomain(freeIpa.getDomain())
                .withPassword(freeIpa.getAdminPassword())
                .withDnssecValidationEnabled(isDnsSecValidationEnabled(stack.getCloudPlatform()))
                .withReverseZones(reverseZones)
                .withAdminUser(freeIpaClientFactory.getAdminUser())
                .withFreeIpaToReplicate(gatewayConfigService.getPrimaryGatewayConfig(stack))
                .withHosts(hosts)
                .withBackupConfig(determineAndSetBackup(stack, proxyConfig))
                .build();
    }

}