in bicep/files-to-load/cyclecloud_install.py [0:0]
def main():
parser = argparse.ArgumentParser(description="usage: %prog [options]")
parser.add_argument("--azureSovereignCloud",
dest="azureSovereignCloud",
default="public",
help="Azure Region [china|germany|public|usgov]")
parser.add_argument("--tenantId",
dest="tenantId",
help="Tenant ID of the Azure subscription")
parser.add_argument("--applicationId",
dest="applicationId",
help="Application ID of the Service Principal")
parser.add_argument("--applicationSecret",
dest="applicationSecret",
help="Application Secret of the Service Principal")
parser.add_argument("--createAdminUser",
dest="createAdminUser",
action="store_false",
help="Configure the CC Admin user with SSH key (default: False - requires root privileges)")
parser.add_argument("--username",
dest="username",
default="cc_admin",
help="The local admin user for the CycleCloud VM")
parser.add_argument("--hostname",
dest="hostname",
help="The short public hostname assigned to this VM (or public IP), used for LetsEncrypt")
parser.add_argument("--acceptTerms",
dest="acceptTerms",
action="store_true",
help="Accept Cyclecloud terms and do a silent install")
parser.add_argument("--useLetsEncrypt",
dest="useLetsEncrypt",
action="store_true",
help="Automatically fetch certificate from Let's Encrypt. (Only suitable for installations with public IP.)")
parser.add_argument("--useManagedIdentity",
dest="useManagedIdentity",
action="store_true",
help="Use the first assigned Managed Identity rather than a Service Principle for the default account")
parser.add_argument("--dryrun",
dest="dryrun",
action="store_true",
help="Allow local testing outside Azure Docker")
parser.add_argument("--password",
dest="password",
default="",
help="The password for the CycleCloud UI user")
parser.add_argument("--publickey",
dest="publickey",
help="The public ssh key for the CycleCloud UI user")
parser.add_argument("--storageAccount",
dest="storageAccount",
help="The storage account to use as a CycleCloud locker")
parser.add_argument("--resourceGroup",
dest="resourceGroup",
help="The resource group for CycleCloud cluster resources. Resource Group must already exist. (Default: same RG as CycleCloud)")
parser.add_argument("--noDefaultAccount",
dest="no_default_account",
action="store_true",
help="Do not attempt to configure a default CycleCloud Account (useful for CycleClouds managing other subscriptions)")
parser.add_argument("--webServerMaxHeapSize",
dest="webServerMaxHeapSize",
default='8192M',
help="CycleCloud max heap")
parser.add_argument("--webServerPort",
dest="webServerPort",
default=8080,
help="CycleCloud front-end HTTP port")
parser.add_argument("--webServerSslPort",
dest="webServerSslPort",
default=8443,
help="CycleCloud front-end HTTPS port")
parser.add_argument("--webServerClusterPort",
dest="webServerClusterPort",
default=9443,
help="CycleCloud cluster/back-end HTTPS port")
parser.add_argument("--webServerHostname",
dest="webServerHostname",
default="",
help="Over-ride CycleCloud hostname for cluster/back-end connections")
parser.add_argument("--insidersBuild",
dest="insidersBuild",
default=False,
action="store_true",
help="Use insiders build of CycleCloud")
parser.add_argument("--storageManagedIdentity",
dest="storageManagedIdentity",
default=None,
help="Use a specified Managed Identity for storage access from the compute nodes")
parser.add_argument("--acceptMarketplaceTerms",
dest="acceptMarketplaceTerms",
action="store_true",
help="Accept the Azure Marketplace terms for OS images")
args = parser.parse_args()
print("Debugging arguments: %s" % args)
if not already_installed():
configure_msft_repos(args.insidersBuild)
install_pre_req()
download_install_cc()
modify_cs_config(options = {'webServerMaxHeapSize': args.webServerMaxHeapSize,
'webServerPort': args.webServerPort,
'webServerSslPort': args.webServerSslPort,
'webServerClusterPort': args.webServerClusterPort,
'webServerEnableHttps': True,
'webServerHostname': args.webServerHostname})
start_cc()
install_cc_cli()
if not args.dryrun:
vm_metadata = get_vm_metadata()
else:
vm_metadata = {"compute": {
"subscriptionId": "1234-50-679890",
"location": "dryrun",
"resourceGroupName": "dryrun-rg"}}
if args.resourceGroup:
print("CycleCloud created in resource group: %s" % vm_metadata["compute"]["resourceGroupName"])
print("Cluster resources will be created in resource group: %s" % args.resourceGroup)
vm_metadata["compute"]["resourceGroupName"] = args.resourceGroup
cyclecloud_account_setup(vm_metadata, args.useManagedIdentity, args.tenantId, args.applicationId,
args.applicationSecret, args.username, args.azureSovereignCloud,
args.acceptTerms, args.password, args.storageAccount,
args.no_default_account, args.webServerSslPort, args.storageManagedIdentity,
args.acceptMarketplaceTerms)
if args.useLetsEncrypt:
letsEncrypt(args.hostname)
# Create user requires root privileges
if args.createAdminUser:
create_user_credential(args.username, args.publickey)
clean_up()