Skip to content

Commit

Permalink
fix formatting (#1167)
Browse files Browse the repository at this point in the history
  • Loading branch information
anhowe authored Apr 23, 2021
1 parent 3894b84 commit ebfe7cd
Show file tree
Hide file tree
Showing 107 changed files with 4,980 additions and 4,982 deletions.
64 changes: 32 additions & 32 deletions src/terraform/examples/azcopysync/main.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// customize the simple VM by adjusting the following local variables
locals {
// the region of the deployment
location = "eastus"
vm_admin_username = "azureuser"
vm_admin_password = "PASSWORD"
resource_group_name = "resource_group"
// set the following to true, otherwise use windows server
use_windows_desktop = false

// provide a globally unique name
storage_account_name = "storageaccount"
container_name = "previz"
// the region of the deployment
location = "eastus"
vm_admin_username = "azureuser"
vm_admin_password = "PASSWORD"
resource_group_name = "resource_group"
// set the following to true, otherwise use windows server
use_windows_desktop = false

// provide a globally unique name
storage_account_name = "storageaccount"
container_name = "previz"
}

terraform {
Expand Down Expand Up @@ -67,10 +67,10 @@ resource "azurerm_subnet" "subnet" {
}

resource "azurerm_public_ip" "vm" {
name = "publicip"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
allocation_method = "Static"
name = "publicip"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
allocation_method = "Static"
}

resource "azurerm_network_interface" "nic" {
Expand Down Expand Up @@ -103,38 +103,38 @@ resource "azurerm_windows_virtual_machine" "vm" {
}

dynamic "source_image_reference" {
for_each = local.use_windows_desktop == false ? ["MicrosoftWindowsServer"] : []
content {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2016-Datacenter"
version = "latest"
}
for_each = local.use_windows_desktop == false ? ["MicrosoftWindowsServer"] : []
content {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2016-Datacenter"
version = "latest"
}
}

dynamic "source_image_reference" {
for_each = local.use_windows_desktop == true ? ["MicrosoftWindowsDesktop"] : []
content {
publisher = "MicrosoftWindowsDesktop"
offer = "Windows-10"
sku = "19h2-pro"
version = "latest"
}
for_each = local.use_windows_desktop == true ? ["MicrosoftWindowsDesktop"] : []
content {
publisher = "MicrosoftWindowsDesktop"
offer = "Windows-10"
sku = "19h2-pro"
version = "latest"
}
}
}

output "rdp_username" {
value = local.vm_admin_username
value = local.vm_admin_username
}

output "rdp_address" {
value = azurerm_public_ip.vm.ip_address
}

output "storage_account_container_sas_command_prefix" {
value = "export SAS_PREFIX=https://${local.storage_account_name}.blob.core.windows.net/${local.container_name}?"
value = "export SAS_PREFIX=https://${local.storage_account_name}.blob.core.windows.net/${local.container_name}?"
}

output "storage_account_container_sas_command_suffix" {
value = "export SAS_SUFFIX=$(az storage container generate-sas --account-name ${local.storage_account_name} --https-only --permissions acdlrw --start 2020-04-06T00:00:00Z --expiry 2021-01-01T00:00:00Z --name ${local.container_name} --output tsv)"
value = "export SAS_SUFFIX=$(az storage container generate-sas --account-name ${local.storage_account_name} --https-only --permissions acdlrw --start 2020-04-06T00:00:00Z --expiry 2021-01-01T00:00:00Z --name ${local.container_name} --output tsv)"
}
78 changes: 39 additions & 39 deletions src/terraform/examples/centos-ci/main.tf
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
// customize the Secured VM by adjusting the following local variables
locals {
// the region of the deployment
location = "westus"
vm_admin_username = "azureuser"
// use either SSH Key data or admin password, if ssh_key_data is specified
// then admin_password is ignored
vm_admin_password = "PASSWORD"
// if you use SSH key, ensure you have ~/.ssh/id_rsa with permission 600
// populated where you are running terraform
vm_ssh_key_data = null //"ssh-rsa AAAAB3...."

resource_group_name = "centosresource_group"
vm_size = "Standard_D2s_v3"

// network details
virtual_network_resource_group = "network_resource_group"
virtual_network_name = "rendervnet"
virtual_network_subnet_name = "render_clients2"

# load the files as b64
foreman_file_b64 = base64gzip(replace(file("${path.module}/20-foreman.cfg"),"\r",""))
example_file_b64 = base64gzip(replace(file("${path.module}/examplefile.txt"),"\r",""))

# embed the files
cloud_init_file = templatefile("${path.module}/cloud-init.tpl", { foreman_file = local.foreman_file_b64, example_file_b64 = local.example_file_b64})
// the region of the deployment
location = "westus"
vm_admin_username = "azureuser"
// use either SSH Key data or admin password, if ssh_key_data is specified
// then admin_password is ignored
vm_admin_password = "PASSWORD"
// if you use SSH key, ensure you have ~/.ssh/id_rsa with permission 600
// populated where you are running terraform
vm_ssh_key_data = null //"ssh-rsa AAAAB3...."

resource_group_name = "centosresource_group"
vm_size = "Standard_D2s_v3"

// network details
virtual_network_resource_group = "network_resource_group"
virtual_network_name = "rendervnet"
virtual_network_subnet_name = "render_clients2"

# load the files as b64
foreman_file_b64 = base64gzip(replace(file("${path.module}/20-foreman.cfg"), "\r", ""))
example_file_b64 = base64gzip(replace(file("${path.module}/examplefile.txt"), "\r", ""))

# embed the files
cloud_init_file = templatefile("${path.module}/cloud-init.tpl", { foreman_file = local.foreman_file_b64, example_file_b64 = local.example_file_b64 })
}

terraform {
Expand Down Expand Up @@ -70,35 +70,35 @@ resource "azurerm_linux_virtual_machine" "main" {
network_interface_ids = [azurerm_network_interface.main.id]
computer_name = "vm"
size = local.vm_size

# this encodes the payload
custom_data = base64encode(local.cloud_init_file)
// if needed replace source image reference with the id
custom_data = base64encode(local.cloud_init_file)

// if needed replace source image reference with the id
// source_image_id = "some image id"
source_image_reference {
publisher = "OpenLogic"
offer = "CentOS"
sku = "7_9"
version = "latest"
}
}

// by default the OS has encryption at rest
os_disk {
name = "osdisk"
name = "osdisk"
storage_account_type = "Standard_LRS"
caching = "ReadWrite"
}

admin_username = local.vm_admin_username
admin_password = (local.vm_ssh_key_data == null || local.vm_ssh_key_data == "") && local.vm_admin_password != null && local.vm_admin_password != "" ? local.vm_admin_password : null
admin_username = local.vm_admin_username
admin_password = (local.vm_ssh_key_data == null || local.vm_ssh_key_data == "") && local.vm_admin_password != null && local.vm_admin_password != "" ? local.vm_admin_password : null
disable_password_authentication = (local.vm_ssh_key_data == null || local.vm_ssh_key_data == "") && local.vm_admin_password != null && local.vm_admin_password != "" ? false : true
dynamic "admin_ssh_key" {
for_each = local.vm_ssh_key_data == null || local.vm_ssh_key_data == "" ? [] : [local.vm_ssh_key_data]
content {
username = local.vm_admin_username
public_key = local.vm_ssh_key_data
}
for_each = local.vm_ssh_key_data == null || local.vm_ssh_key_data == "" ? [] : [local.vm_ssh_key_data]
content {
username = local.vm_admin_username
public_key = local.vm_ssh_key_data
}
}
}

Expand All @@ -111,5 +111,5 @@ output "vm_address" {
}

output "ssh_command" {
value = "ssh ${local.vm_admin_username}@${azurerm_network_interface.main.ip_configuration[0].private_ip_address}"
}
value = "ssh ${local.vm_admin_username}@${azurerm_network_interface.main.ip_configuration[0].private_ip_address}"
}
38 changes: 19 additions & 19 deletions src/terraform/examples/centos/cycle/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
locals {
resource_group_name = "cycle_rg"
// paste in the id of the full custom image
vm_size = "Standard_D4s_v3"
vm_size = "Standard_D4s_v3"
vm_admin_username = "azureuser"
// use either SSH Key data or admin password, if ssh_key_data is specified
// then admin_password is ignored
vm_admin_password = "ReplacePassword$"
// if you use SSH key, ensure you have ~/.ssh/id_rsa with permission 600
// populated where you are running terraform
vm_ssh_key_data = null //"ssh-rsa AAAAB3...."

# you can choose to use the marketplace image or a manual install
# 1. true - marketplace image - https://docs.microsoft.com/en-us/azure/cyclecloud/qs-install-marketplace
# 2. false - manual install - this installs on a centos image: https://docs.microsoft.com/en-us/azure/cyclecloud/how-to/install-manual
use_marketplace_image = false

// replace below variables with the infrastructure variables from 0.network
location = ""
location = ""
vnet_jumpbox_subnet_name = ""
vnet_name = ""
vnet_resource_group = ""
vnet_name = ""
vnet_resource_group = ""
}

terraform {
Expand All @@ -43,19 +43,19 @@ resource "azurerm_resource_group" "vm" {
}

module "cyclecloud" {
source = "github.com/Azure/Avere/src/terraform/modules/cyclecloud"
resource_group_name = azurerm_resource_group.vm.name
location = local.location
admin_username = local.vm_admin_username
admin_password = local.vm_admin_password
ssh_key_data = local.vm_ssh_key_data
vm_size = local.vm_size
use_marketplace = local.use_marketplace_image
source = "github.com/Azure/Avere/src/terraform/modules/cyclecloud"
resource_group_name = azurerm_resource_group.vm.name
location = local.location
admin_username = local.vm_admin_username
admin_password = local.vm_admin_password
ssh_key_data = local.vm_ssh_key_data
vm_size = local.vm_size
use_marketplace = local.use_marketplace_image

// network details
virtual_network_resource_group = local.vnet_resource_group
virtual_network_name = local.vnet_name
virtual_network_subnet_name = local.vnet_jumpbox_subnet_name
// network details
virtual_network_resource_group = local.vnet_resource_group
virtual_network_name = local.vnet_name
virtual_network_subnet_name = local.vnet_jumpbox_subnet_name
}

output "nfs_username" {
Expand All @@ -67,5 +67,5 @@ output "nfs_address" {
}

output "ssh_command" {
value = "ssh ${module.cyclecloud.admin_username}@${module.cyclecloud.primary_ip}"
}
value = "ssh ${module.cyclecloud.admin_username}@${module.cyclecloud.primary_ip}"
}
Loading

0 comments on commit ebfe7cd

Please sign in to comment.