allnodeinfo = scope.lookupvar('site::allnodeinfo')
roles = scope.lookupvar('site::roles')
- %w{mailrelay nagiosmaster extranrpeclient muninmaster dbmaster static_mirror static_source static_master}.each do |role|
+ %w{mailrelay nagiosmaster extranrpeclient muninmaster dbmaster static_mirror static_source static_master dns_secondary}.each do |role|
rolehost[role] = []
roles[role].each do |node|
rolehost[role] << allnodeinfo[node]['ipHostNumber']
@def $HOST_STATIC_V4 = (<%= scope.function_filter_ipv4([rolehost['static_mirror'] + rolehost['static_source'] + rolehost['static_master']]).uniq.join(' ') %>);
@def $HOST_STATIC_V6 = (<%= scope.function_filter_ipv6([rolehost['static_mirror'] + rolehost['static_source'] + rolehost['static_master']]).uniq.join(' ') %>);
+@def $HOST_DNS_SECONDARY_V4 = (<%= scope.function_filter_ipv4([rolehost['dns_secondary']]).uniq.join(' ') %>);
+@def $HOST_DNS_SECONDARY_V6 = (<%= scope.function_filter_ipv6([rolehost['dns_secondary']]).uniq.join(' ') %>);
+
@def $HOST_DEBIAN_V4 = (<%= scope.function_filter_ipv4([dbs]).uniq.join(' ') %>);
@def $HOST_DEBIAN_V6 = (<%= scope.function_filter_ipv6([dbs]).uniq.join(' ') %>);
@def $HOST_DEBIAN = ($HOST_DEBIAN_V4 $HOST_DEBIAN_V6);
ssh6allowed = []
if restrict_ssh.include?(hostname) then
- ssh4allowed << %w{$DSA_IPS $HOST_NAGIOS_V4 $HOST_MUNIN_V4 $HOST_DB_V4}
+ ssh4allowed << %w{$DSA_IPS $HOST_NAGIOS_V4 $HOST_MUNIN_V4 $HOST_DB_V4}
ssh6allowed << %w{$DSA_V6_IPS $HOST_NAGIOS_V6 $HOST_MUNIN_V6 $HOST_DB_V6}
if %w{lebrun schroeder}.include?(hostname) then
ssh4allowed << %w{$HOST_DEBIAN_V4}
ssh6allowed << %w{$HOST_DEBIAN_V6}
end
- if %w{denis}.include?(hostname) then
+ if scope.function_has_role(['dns_primary']) then
ssh4allowed << "5.153.231.5" # adayevskaya
ssh6allowed << "2001:41c8:1000:21::21:5" # adayevskaya
+ ssh4allowed << "$HOST_DNS_SECONDARY_V4"
+ ssh6allowed << "$HOST_DNS_SECONDARY_V6"
end
if scope.function_has_role(['static_master']) then
@ferm::rule { '01-dsa-bind-4':
domain => '(ip)',
description => 'Allow nameserver access',
- rule => '&TCP_UDP_SERVICE_RANGE(53, $HOST_DEBIAN_V4)',
+ rule => '&TCP_UDP_SERVICE_RANGE(53, $HOST_DNS_SECONDARY_V4)',
}
@ferm::rule { '01-dsa-bind-6':
domain => '(ip6)',
description => 'Allow nameserver access',
- rule => '&TCP_UDP_SERVICE_RANGE(53, $HOST_DEBIAN_V6)',
+ rule => '&TCP_UDP_SERVICE_RANGE(53, $HOST_DNS_SECONDARY_V6)',
}
} else {
@ferm::rule { '01-dsa-bind':