diff --git a/Netdisco/Changes b/Netdisco/Changes index f348af68..0c087e45 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -24,6 +24,7 @@ * Correct date formatting and logic in IP Inventory report * Fix redirect when accessing a deep link when unauthenticated * [#46] Sorting on Inventory page same as ND1 + * Quieten AnyEvent::DNS::EtcHosts check on PERL_ANYEVENT_HOSTS env var 2.022000 - 2014-01-26 diff --git a/Netdisco/bin/netdisco-daemon-fg b/Netdisco/bin/netdisco-daemon-fg index ff7ff87c..783932aa 100755 --- a/Netdisco/bin/netdisco-daemon-fg +++ b/Netdisco/bin/netdisco-daemon-fg @@ -26,9 +26,11 @@ use Role::Tiny::With; use MCE::Signal '-setpgrp'; use MCE; -# set max outstanding requests for AnyEvent::DNS +# set defaults for AnyEvent::DNS local $ENV{'PERL_ANYEVENT_MAX_OUTSTANDING_DNS'} = setting('dns')->{max_outstanding} || 10; +local $ENV{'PERL_ANYEVENT_HOSTS'} + = setting('dns')->{hosts_file} || '/etc/hosts'; # set temporary MCE files' location in home directory my $home = ($ENV{NETDISCO_HOME} || $ENV{HOME}); diff --git a/Netdisco/bin/netdisco-do b/Netdisco/bin/netdisco-do index 0629acba..12e5e1ba 100755 --- a/Netdisco/bin/netdisco-do +++ b/Netdisco/bin/netdisco-do @@ -58,6 +58,8 @@ Dancer::Logger->init('console', $CONFIG); # set max outstanding requests for AnyEvent::DNS local $ENV{'PERL_ANYEVENT_MAX_OUTSTANDING_DNS'} = setting('dns')->{max_outstanding} || 10; +local $ENV{'PERL_ANYEVENT_HOSTS'} + = setting('dns')->{hosts_file} || '/etc/hosts'; # for the in-memory local job queue schema('daemon')->deploy; diff --git a/Netdisco/lib/App/Netdisco.pm b/Netdisco/lib/App/Netdisco.pm index 74eb6fdd..b4fa2961 100644 --- a/Netdisco/lib/App/Netdisco.pm +++ b/Netdisco/lib/App/Netdisco.pm @@ -81,6 +81,7 @@ setting('plugins')->{DBIC}->{daemon} = { # force skipped DNS resolution, if unset setting('dns')->{no} ||= ['fe80::/64','169.254.0.0/16']; +setting('dns')->{hosts_file} ||= '/etc/hosts'; =head1 NAME diff --git a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod index 62fbed20..84a83a01 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod @@ -648,14 +648,21 @@ of days will be removed. =head3 C -Value: Settings Tree. Default: C +Value: Settings Tree. Default: + + dns: + max_outstanding: 10 + hosts_file: '/etc/hosts' + no: ['fe80::/64','169.254.0.0/16'] After arpnip, each found IP will have its DNS name resolved. Similarly on device discovery, all interface aliases will have their IPs resolved to names. This setting controls how many outstanding DNS queries are permitted at any time. You can also override this setting using the -C environment variable. +C environment variable. Similarly, the +location of the Hosts file can be overridden in this config, or using the +C environment variable. =head3 C diff --git a/Netdisco/share/config.yml b/Netdisco/share/config.yml index 6ede1246..d55b5f14 100644 --- a/Netdisco/share/config.yml +++ b/Netdisco/share/config.yml @@ -165,8 +165,9 @@ workers: sleep_time: 2 dns: - no: ['fe80::/64','169.254.0.0/16'] max_outstanding: 10 + hosts_file: '/etc/hosts' + no: ['fe80::/64','169.254.0.0/16'] #housekeeping: # discoverall: