Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of terramodtest 0.5.0 #127

Merged
merged 4 commits into from
Apr 5, 2020
Merged
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- docker

env:
- TERRAFORM_VERSION=0.12.10 IMAGE_NAME=azure-compute-module
- TERRAFORM_VERSION=0.12.20 IMAGE_NAME=azure-compute-module

jobs:
include:
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Pull the base image with given version.
ARG BUILD_TERRAFORM_VERSION="0.12.10"
ARG BUILD_TERRAFORM_VERSION="0.12.20"
FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}

ARG MODULE_NAME="terraform-azurerm-compute"
Expand Down Expand Up @@ -33,6 +33,5 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa
ENV GOPATH /go
ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH
RUN /bin/bash -c "curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh"
RUN terraform init

RUN ["bundle", "install", "--gemfile", "./Gemfile"]
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
ruby "~> 2.3.0"

source 'https://rubygems.org/'

group :test do
git 'https://github.com/Azure/terramodtest.git' do
gem 'terramodtest', :tag => 'v0.3.0'
gem 'terramodtest', tag: '0.5.0'
end
end
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ More specifically this provisions:
- "enable_ssh_key" Enable ssh key authentication in Linux virtual Machine

```hcl
provider "azurerm" {
features {}
}

resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
Expand All @@ -107,14 +111,15 @@ module "linuxservers" {
nb_instances = 2
vm_os_publisher = "Canonical"
vm_os_offer = "UbuntuServer"
vm_os_sku = "14.04.2-LTS"
vm_os_sku = "18.04-LTS"
vnet_subnet_id = module.network.vnet_subnets[0]
boot_diagnostics = true
delete_os_disk_on_termination = true
nb_data_disk = 2
data_disk_size_gb = 64
data_sa_type = "Premium_LRS"
enable_ssh_key = true
vm_size = "Standard_D4s_v3"

tags = {
environment = "dev"
Expand All @@ -128,6 +133,7 @@ module "windowsservers" {
source = "Azure/compute/azurerm"
resource_group_name = azurerm_resource_group.example.name
vm_hostname = "mywinvm"
is_windows_image = true
admin_password = "ComplxP@ssw0rd!"
public_ip_dns = ["winterravmip", "winterravmip1"]
nb_public_ip = 2
Expand All @@ -137,17 +143,15 @@ module "windowsservers" {
vm_os_offer = "WindowsServer"
vm_os_sku = "2012-R2-Datacenter"
vm_size = "Standard_DS2_V2"
vnet_subnet_id = module.network.vnet_subnets[1]
vnet_subnet_id = module.network.vnet_subnets[0]
enable_accelerated_networking = true
}

module "network" {
source = "Azure/network/azurerm"
version = "3.0.0"
version = "3.0.1"
resource_group_name = azurerm_resource_group.example.name
allow_rdp_traffic = true
allow_ssh_traffic = true
subnet_prefixes = ["10.0.1.0/24", "10.0.2.0/24"]
subnet_prefixes = ["10.0.1.0/24"]

}

Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "azurerm_virtual_machine" "vm-linux" {
}

os_profile {
computer_name = "myLinux"
computer_name = "${var.vm_hostname}-${count.index}"
admin_username = var.admin_username
admin_password = var.admin_password
custom_data = var.custom_data
Expand Down Expand Up @@ -125,7 +125,7 @@ resource "azurerm_virtual_machine" "vm-windows" {
}

os_profile {
computer_name = "myWindows"
computer_name = "${var.vm_hostname}-${count.index}"
admin_username = var.admin_username
admin_password = var.admin_password
}
Expand Down