From 99921ef219b6f2fd60b2ed0542635a989784fb54 Mon Sep 17 00:00:00 2001 From: Han Tuzun Date: Wed, 25 Oct 2017 15:54:30 +0300 Subject: [PATCH 1/3] Minor updates to README.md --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3923ab0..efa8359 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ You can watch [this online meetup](https://youtu.be/ifNitKh-L0o?t=2231) about Te * It is assumed that you have a functioning Azure client installed. You can do so [here](https://github.com/Azure/azure-cli) -* Install [Terraform](https://www.terraform.io/downloads.html) and create credentials for Terraform to access Azure. To do so, you will need to following environment variables : +* Install [Terraform](https://www.terraform.io/downloads.html) and create credentials for Terraform to access Azure. To do so, you will need to following environment variables: * ARM_SUBSCRIPTION_ID= * ARM_CLIENT_ID= @@ -52,8 +52,7 @@ $ az account show } } -export SUBSCRIPTIONID=`az account show --output tsv | cut -f2` - +export ARM_SUBSCRIPTION_ID=`az account show --output tsv | cut -f2` ``` * Create an Azure application @@ -61,7 +60,7 @@ export SUBSCRIPTIONID=`az account show --output tsv | cut -f2` ```bash $ export PASSWORD=`openssl rand -base64 24` -$ az ad app create --display-name dcosterraform--identifier-uris http://docs.mesosphere.com --homepage http://www.mesosphere.com --password $PASSWORD +$ az ad app create --display-name dcosterraform --identifier-uris http://docs.mesosphere.com --homepage http://www.mesosphere.com --password $PASSWORD $ unset PASSWORD ``` @@ -77,7 +76,7 @@ $ az ad sp create --id $APPID * Grant Permissions To Your Application ```bash -$ az role assignment create --assignee http://docs.mesosphere.com --role "Owner" --scope /subscriptions/$SUBSCRIPTIONID +$ az role assignment create --assignee http://docs.mesosphere.com --role "Owner" --scope /subscriptions/$ARM_SUBSCRIPTION_ID ``` @@ -89,7 +88,7 @@ $ az ad app list --display-name dcosterraform *NOTE: A more detailed overview can be found on the [Terraform Site](https://www.terraform.io/docs/providers/azurerm/index.html)* -## Deploy the Azure infrastructure and DC/OS +## Deploy the Azure infrastructure and DC/OS ## * First, review the default configuratiion. Most common options are available in `terraform/dcos/terraform.tfvars`. The full list of available options are in `terraform/dcos/variables.tf`. CoreOS is the default as it has pre-requirements built in. From fafd2e235afca1243b79654d551dc96a9ead33b0 Mon Sep 17 00:00:00 2001 From: Han Tuzun Date: Wed, 25 Oct 2017 17:36:07 +0300 Subject: [PATCH 2/3] Add install_script_url and bootstrap_script_url to terraform/variables.tf --- terraform/variables.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/terraform/variables.tf b/terraform/variables.tf index 55b75d1..115573f 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -4,6 +4,10 @@ variable "resource_suffix" {} variable "dcos_download_url" {} +variable "install_script_url" {} + +variable "bootstrap_script_url" {} + variable "private_key_path" {} variable "public_key_path" {} From 725fb19cade120c3c4f7cc1fd0f6d7c48a6ee969 Mon Sep 17 00:00:00 2001 From: Han Tuzun Date: Wed, 25 Oct 2017 17:43:50 +0300 Subject: [PATCH 3/3] Fix azurerm_storage_account account_type parameters Fixing: * The following warning: * azurerm_storage_account.mystorageaccount: 'account_type': [DEPRECATED] This field has been split into and * The following errors: * azurerm_storage_account.mystorageaccount: 'account_replication_type': required field is not set * azurerm_storage_account.mystorageaccount: 'account_tier': required field is not set --- terraform/agent_private.tf | 11 ++++++----- terraform/agent_public.tf | 11 ++++++----- terraform/bootstrap.tf | 9 +++++---- terraform/master.tf | 9 +++++---- terraform/state.tf | 9 +++++---- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/terraform/agent_private.tf b/terraform/agent_private.tf index d1f2714..a7848c2 100644 --- a/terraform/agent_private.tf +++ b/terraform/agent_private.tf @@ -1,9 +1,10 @@ resource "azurerm_storage_account" "agent_private" { - name = "${substr(sha1(uuid()), 0, 20)}" - resource_group_name = "${azurerm_resource_group.dcos.name}" - location = "${azurerm_resource_group.dcos.location}" - count = 5 - account_type = "Standard_LRS" + name = "${substr(sha1(uuid()), 0, 20)}" + resource_group_name = "${azurerm_resource_group.dcos.name}" + location = "${azurerm_resource_group.dcos.location}" + count = 5 + account_tier = "Standard" + account_replication_type = "LRS" lifecycle { ignore_changes = ["name"] diff --git a/terraform/agent_public.tf b/terraform/agent_public.tf index 9e92fb1..f68f7fd 100644 --- a/terraform/agent_public.tf +++ b/terraform/agent_public.tf @@ -120,11 +120,12 @@ resource "azurerm_lb_rule" "agent_public_9090" { } resource "azurerm_storage_account" "agent_public" { - name = "${substr(sha1(uuid()), 0, 20)}" - resource_group_name = "${azurerm_resource_group.dcos.name}" - location = "${azurerm_resource_group.dcos.location}" - count = 5 - account_type = "Standard_LRS" + name = "${substr(sha1(uuid()), 0, 20)}" + resource_group_name = "${azurerm_resource_group.dcos.name}" + location = "${azurerm_resource_group.dcos.location}" + count = 5 + account_tier = "Standard" + account_replication_type = "LRS" lifecycle { ignore_changes = ["name"] diff --git a/terraform/bootstrap.tf b/terraform/bootstrap.tf index 7ca9545..479718d 100644 --- a/terraform/bootstrap.tf +++ b/terraform/bootstrap.tf @@ -21,10 +21,11 @@ resource "azurerm_network_interface" "bootstrap" { } resource "azurerm_storage_account" "bootstrap" { - name = "bootstrapstorage${var.resource_suffix}" - resource_group_name = "${azurerm_resource_group.dcos.name}" - location = "${azurerm_resource_group.dcos.location}" - account_type = "Standard_LRS" + name = "bootstrapstorage${var.resource_suffix}" + resource_group_name = "${azurerm_resource_group.dcos.name}" + location = "${azurerm_resource_group.dcos.location}" + account_tier = "Standard" + account_replication_type = "LRS" } resource "azurerm_virtual_machine" "bootstrap" { diff --git a/terraform/master.tf b/terraform/master.tf index f35d141..aa866b4 100644 --- a/terraform/master.tf +++ b/terraform/master.tf @@ -83,10 +83,11 @@ resource "azurerm_availability_set" "master" { } resource "azurerm_storage_account" "master" { - name = "masterstorage${var.resource_suffix}" - resource_group_name = "${azurerm_resource_group.dcos.name}" - location = "${azurerm_resource_group.dcos.location}" - account_type = "Standard_LRS" + name = "masterstorage${var.resource_suffix}" + resource_group_name = "${azurerm_resource_group.dcos.name}" + location = "${azurerm_resource_group.dcos.location}" + account_tier = "Standard" + account_replication_type = "LRS" } resource "azurerm_virtual_machine" "master" { diff --git a/terraform/state.tf b/terraform/state.tf index 900661e..e8ec7e9 100644 --- a/terraform/state.tf +++ b/terraform/state.tf @@ -11,10 +11,11 @@ resource "azurerm_resource_group" "dcos" { } resource "azurerm_storage_account" "dcos" { - name = "sa${var.resource_base_name}${var.resource_suffix}" - resource_group_name = "${azurerm_resource_group.dcos.name}" - location = "${azurerm_resource_group.dcos.location}" - account_type = "Standard_LRS" + name = "sa${var.resource_base_name}${var.resource_suffix}" + resource_group_name = "${azurerm_resource_group.dcos.name}" + location = "${azurerm_resource_group.dcos.location}" + account_tier = "Standard" + account_replication_type = "LRS" } resource "azurerm_storage_container" "state" {