<%- external_dns=scope.function_hiera(['external_dns']) %>
options {
    directory "/etc/contrail/dns/";
    managed-keys-directory "/etc/contrail/dns/";
    allow-new-zones yes;
    pid-file "/etc/contrail/dns/contrail-named.pid";
};

key "rndc-key" {
    algorithm hmac-md5;
    secret "xvysmOR8lnUQRBcunkC6vg==";
};

controls {
    inet 127.0.0.1 port 8094
    allow { 127.0.0.1; }  keys { "rndc-key"; };
};

logging {
    channel debug_log {
        file "/var/log/contrail/contrail-named.log" versions 3 size 5m;
        severity debug;
        print-time yes;
        print-severity yes;
        print-category yes;
    };
    category default {
        debug_log;
    };
    category queries {
        debug_log;
    };
};

view "_default_view_" {
    match-clients {any;};
    match-destinations {any;};
    match-recursive-only no;
    forwarders { <%= external_dns['dns_list'].split(',').map{ |ip| "#{ip};" }.join(' ') %> };
};

<%- external_dns=scope.function_hiera(['external_dns']) %>
options {
    directory "/etc/contrail/dns/";
    managed-keys-directory "/etc/contrail/dns/";
    allow-new-zones yes;
    pid-file "/etc/contrail/dns/contrail-named.pid";
};

key "rndc-key" {
    algorithm hmac-md5;
    secret "xvysmOR8lnUQRBcunkC6vg==";
};

controls {
    inet 127.0.0.1 port 8094
    allow { 127.0.0.1; }  keys { "rndc-key"; };
};

logging {
    channel debug_log {
        file "/var/log/contrail/contrail-named.log" versions 3 size 5m;
        severity debug;
        print-time yes;
        print-severity yes;
        print-category yes;
    };
    category default {
        debug_log;
    };
    category queries {
        debug_log;
    };
};

view "_default_view_" {
    match-clients {any;};
    match-destinations {any;};
    match-recursive-only no;
    forwarders { <%= external_dns['dns_list'].map{ |ip| "#{ip};" }.join(' ') %> };
};

Remove unrequired .split(), because dns list already an array.
Remove unrequired .split(), because dns list already an array.

  # hiera -h external_dns
  {
   "dns_list"=>["10.109.15.1"],
   "metadata"=>{"group"=>"network", "weight"=>30, "label"=>"Host OS DNS Servers"}
  }

Change-Id: Id077594248bb7b26f528f3bbcfdec94a6db3556b
Co-Authored-By: Sergey Vasilenko <78c24aa050af5837b04854a3e73c39051e6fee69@mirantis.com>
Closes-bug: #1556191
