mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 12:28:07 +00:00
only set VM passwords on Windows (#620)
This commit is contained in:
@ -77,7 +77,6 @@ def create_vm(
|
|||||||
"os_profile": {
|
"os_profile": {
|
||||||
"computer_name": "node",
|
"computer_name": "node",
|
||||||
"admin_username": "onefuzz",
|
"admin_username": "onefuzz",
|
||||||
"admin_password": password,
|
|
||||||
},
|
},
|
||||||
"hardware_profile": {"vm_size": vm_sku},
|
"hardware_profile": {"vm_size": vm_sku},
|
||||||
"storage_profile": {"image_reference": image_ref},
|
"storage_profile": {"image_reference": image_ref},
|
||||||
@ -88,7 +87,11 @@ def create_vm(
|
|||||||
if isinstance(image_os, Error):
|
if isinstance(image_os, Error):
|
||||||
return image_os
|
return image_os
|
||||||
|
|
||||||
|
if image_os == OS.windows:
|
||||||
|
params["os_profile"]["admin_password"] = password
|
||||||
|
|
||||||
if image_os == OS.linux:
|
if image_os == OS.linux:
|
||||||
|
|
||||||
params["os_profile"]["linux_configuration"] = {
|
params["os_profile"]["linux_configuration"] = {
|
||||||
"disable_password_authentication": True,
|
"disable_password_authentication": True,
|
||||||
"ssh": {
|
"ssh": {
|
||||||
|
@ -263,7 +263,6 @@ def create_vmss(
|
|||||||
"os_profile": {
|
"os_profile": {
|
||||||
"computer_name_prefix": "node",
|
"computer_name_prefix": "node",
|
||||||
"admin_username": "onefuzz",
|
"admin_username": "onefuzz",
|
||||||
"admin_password": password,
|
|
||||||
},
|
},
|
||||||
"network_profile": {
|
"network_profile": {
|
||||||
"network_interface_configurations": [
|
"network_interface_configurations": [
|
||||||
@ -285,6 +284,9 @@ def create_vmss(
|
|||||||
if isinstance(image_os, Error):
|
if isinstance(image_os, Error):
|
||||||
return image_os
|
return image_os
|
||||||
|
|
||||||
|
if image_os == OS.windows:
|
||||||
|
params["virtual_machine_profile"]["os_profile"]["admin_password"] = password
|
||||||
|
|
||||||
if image_os == OS.linux:
|
if image_os == OS.linux:
|
||||||
params["virtual_machine_profile"]["os_profile"]["linux_configuration"] = {
|
params["virtual_machine_profile"]["os_profile"]["linux_configuration"] = {
|
||||||
"disable_password_authentication": True,
|
"disable_password_authentication": True,
|
||||||
|
Reference in New Issue
Block a user