Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions templates/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
SIZE = 'size'
VM_COPIES = 'numberOfVMReplicas'
ZONES = 'zones'
LABELS = 'labels'

# Common properties values (only official GCP values allowed here)
EXTERNAL = 'External NAT'
Expand Down
8 changes: 4 additions & 4 deletions templates/vm_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
STATIC_IP = 'staticIP'
NAT_IP = 'natIP'
HAS_EXTERNAL_IP = 'hasExternalIP'
LABELS = default.LABELS

# Defaults used for modules that imports this one
DEFAULT_DISKTYPE = 'pd-standard'
Expand All @@ -60,10 +61,7 @@
DEFAULT_SERVICE_ACCOUNT = [{
'email': 'default',
'scopes': [
'https://www.googleapis.com/auth/cloud.useraccounts.readonly',
'https://www.googleapis.com/auth/devstorage.read_only',
'https://www.googleapis.com/auth/logging.write',
'https://www.googleapis.com/auth/monitoring.write',
'https://www.googleapis.com/auth/cloud-platform',
]
}]

Expand Down Expand Up @@ -117,6 +115,7 @@ def GenerateComputeVM(context, create_disks_separately=True):

machine_type = prop.setdefault(MACHINETYPE, DEFAULT_MACHINETYPE)
metadata = prop.setdefault(METADATA, dict())
labels = prop.setdefault(LABELS, dict())
network = prop.setdefault(NETWORK, DEFAULT_NETWORK)
vm_name = MakeVMName(context)
provide_boot = prop.setdefault(PROVIDE_BOOT, DEFAULT_PROVIDE_BOOT)
Expand Down Expand Up @@ -196,6 +195,7 @@ def GenerateComputeVM(context, create_disks_separately=True):
'networkInterfaces': network_interfaces,
'tags': tags,
'metadata': metadata,
'labels': labels,
}
})

Expand Down