Merge configs for the same hosts instead of using the last one
This commit is contained in:
parent
d3a353990b
commit
611b41e7a6
1 changed files with 8 additions and 3 deletions
|
@ -1639,11 +1639,16 @@ sub _read_config {
|
||||||
|
|
||||||
## allow {host} to be a comma separated list of hosts
|
## allow {host} to be a comma separated list of hosts
|
||||||
foreach my $h (split_by_comma($host)) {
|
foreach my $h (split_by_comma($host)) {
|
||||||
|
if ($config{$h}) {
|
||||||
|
## host already defined, merging configs
|
||||||
|
$config{$h} = { %{merge($config{$h}, \%locals)} };
|
||||||
|
} else {
|
||||||
## save a copy of the current globals
|
## save a copy of the current globals
|
||||||
$config{$h} = { %locals };
|
$config{$h} = { %locals };
|
||||||
$config{$h}{'host'} = $h;
|
$config{$h}{'host'} = $h;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
%passwords = ();
|
%passwords = ();
|
||||||
}
|
}
|
||||||
close(FD);
|
close(FD);
|
||||||
|
|
Loading…
Reference in a new issue