From 06f679d7e792c4cd5c938343b2f7b54a259ff704 Mon Sep 17 00:00:00 2001 From: Digimer Date: Mon, 30 Aug 2021 22:40:35 -0400 Subject: [PATCH] * Added the ability to disable anvil-daemon management of /etc/hosts. * Updated the OS variant list. Signed-off-by: Digimer --- Anvil/Tools/System.pm | 9 +++++++++ share/words.xml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/Anvil/Tools/System.pm b/Anvil/Tools/System.pm index bfd8cbef..0e08089a 100644 --- a/Anvil/Tools/System.pm +++ b/Anvil/Tools/System.pm @@ -4823,6 +4823,8 @@ sub test_ipmi This uses the host list from C<< Get->trusted_hosts >>, along with data from C<< ip_addresses >>, to create a list of host name to IP addresses that should be in C<< /etc/hosts >>. Existing hosts where the IP has changed will be updated. Missing entries will be added. All other existing entries are left unchanged. +B<< Note >>: If C<< sys::hosts::manage >> is set to C<< 0 >>, this method will return without doing anything + This method takes no parameters. =cut @@ -4834,6 +4836,13 @@ sub update_hosts my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3; $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "System->update_hosts()" }}); + # Is managing hosts disabled? + if ((exists $anvil->data->{sys}{hosts}{manage}) && ($anvil->data->{sys}{hosts}{manage} eq "0")) + { + $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0648"}); + return(0); + } + # Get the list of hosts we trust. my $trusted_host_uuids = $anvil->Get->trusted_hosts({debug => $debug}); $anvil->Database->get_ip_addresses({debug => $debug}); diff --git a/share/words.xml b/share/words.xml index 93f4ff27..611036d7 100644 --- a/share/words.xml +++ b/share/words.xml @@ -1897,6 +1897,7 @@ The file: [#!variable!file!#] needs to be updated. The difference is: Reloading corosync config. #!variable!program!# is disabled in anvil.conf. and '--force' was not used. Exiting. [ Note ] - The network interface: [#!variable!name!#] with 'network_interface_uuid': [#!variable!uuid!#] is a duplicate, removing it from the database(s). + [ Note ] - Managing /etc/hosts has been disabled. The host name: [#!variable!target!#] does not resolve to an IP address. @@ -2921,6 +2922,11 @@ We will sleep a bit and try again. + + + + + @@ -3078,6 +3084,8 @@ We will sleep a bit and try again. + + @@ -3106,12 +3114,16 @@ We will sleep a bit and try again. + + + + @@ -3125,6 +3137,7 @@ We will sleep a bit and try again. + @@ -3176,12 +3189,16 @@ We will sleep a bit and try again. + + + + @@ -3259,6 +3276,7 @@ We will sleep a bit and try again. + @@ -3353,6 +3371,8 @@ We will sleep a bit and try again. + + @@ -3428,6 +3448,9 @@ We will sleep a bit and try again. + + + @@ -3484,6 +3507,11 @@ We will sleep a bit and try again. + + + + + @@ -3549,6 +3577,7 @@ We will sleep a bit and try again. + @@ -3587,6 +3616,7 @@ We will sleep a bit and try again. +