diff --git a/ManageBulkInstances.pm b/ManageBulkInstances.pm index 993b519..b912d21 100644 --- a/ManageBulkInstances.pm +++ b/ManageBulkInstances.pm @@ -55,7 +55,7 @@ my $os_auth_url = $ENV{'OS_AUTH_URL'}; my $ssh_options = "-o StrictHostKeyChecking=no"; # StrictHostKeyChecking=no because I am too lazy to check for the question. -my $vm_user = 'ubuntu'; +our $vm_user = 'ubuntu'; my @hobbitlist = ("Frodo","Samwise","Meriadoc","Peregrin","Gandalf","Aragorn","Legolas","Gimli","Denethor","Boromir","Faramir","Galadriel","Celeborn","Elrond","Bilbo","Theoden","Eomer","Eowyn","Treebeard"); @@ -125,6 +125,7 @@ our $options_specify = [ "Specify existing VMs for actions and deletion", our $options_other_opts = ["Other options", "noownercheck" => "disables owner check", undef, + "vm_user=s" => "username for vm login and home dir", undef, "debug" => "debug info", undef ]; diff --git a/vmAWE.pl b/vmAWE.pl index cc365ef..3b016b2 100755 --- a/vmAWE.pl +++ b/vmAWE.pl @@ -87,6 +87,11 @@ # get values from config file ManageBulkInstances::read_config_file(\%arg_hash, "default"); +unless (defined $arg_hash{"vm_user"}) { + $arg_hash{"vm_user"} = $ManageBulkInstances::vm_user; +} +$ManageBulkInstances::vm_user = $arg_hash{"vm_user"}; + # get values from IP file if (defined $arg_hash{"ipfile"}) { ManageBulkInstances::read_config_file(\%arg_hash, $arg_hash{"ipfile"});