Skip to content

Commit

Permalink
Merge pull request #648 from SUSE/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
arbulu89 authored Mar 2, 2021
2 parents c1f5b91 + 44ca5f0 commit 8a36dac
Show file tree
Hide file tree
Showing 137 changed files with 3,888 additions and 2,798 deletions.
2 changes: 1 addition & 1 deletion .github/hana-netweaver-tf-only.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# qemu_uri =
# source_image =

hana_inst_media = "10.162.32.134:/sapdata/sap_inst_media/51053787"
hana_inst_master = "10.162.32.134:/sapdata/sap_inst_media/51053787"
iprange = "192.168.25.0/24"

storage_pool = "terraform"
Expand Down
1 change: 1 addition & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable=SC1091
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
dist: xenial
dist: focal
addons:
apt:
packages:
- shellcheck

matrix:
include:
- language: bash
install:
- set -e
- curl -sLo /tmp/terraform.zip https://releases.hashicorp.com/terraform/0.12.6/terraform_0.12.6_linux_amd64.zip
- curl -sLo /tmp/terraform.zip https://releases.hashicorp.com/terraform/0.13.4/terraform_0.13.4_linux_amd64.zip
- unzip /tmp/terraform -d /tmp
- chmod +x /tmp/terraform
- /tmp/terraform -version
script:
- .ci/validate-terraform.sh
- shellcheck salt/provision.sh
- language: node_js
install:
- npm install -g jsonlint
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Automated SAP/HA Deployments in Public/Private Clouds with Terraform

[![Build Status](https://travis-ci.org/SUSE/ha-sap-terraform-deployments.svg?branch=master)](https://travis-ci.org/SUSE/ha-sap-terraform-deployments)
**Supported terraform version `0.12.6`**
**Supported terraform version `0.13.4`**
___

# Supported cloud providers
Expand All @@ -15,12 +15,13 @@ ___
## Major features

- HA Clusters and HANA deployment
- [Preparing SAP software](doc/sap_software.md)
- [Monitoring of cluster](doc/monitoring.md)
- [Netweaver](doc/netweaver.md)
- [DRBD](doc/drbd.md)
- [QA](doc/qa.md)
- [Saptune](doc/saptune.md)
- [SBD](doc/sbd.md)
- [Fencing mechanism](doc/fencing.md)
- [IP addresses auto generation](doc/ip_autogeneration.md)

## Templates
Expand Down
4 changes: 2 additions & 2 deletions aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Now, the created file must be configured to define the deployment.

Alternatively, you can set the `pre_deployment` variable to automatically create the cluster ssh keys.
```
mkdir ../salt/hana_node/files/sshkeys
ssh-keygen -t rsa -N '' -f ../salt/hana_node/files/sshkeys/cluster.id_rsa
mkdir -p ../salt/sshkeys
ssh-keygen -f ../salt/sshkeys/cluster.id_rsa -q -P ""
```

The key files need to have same name as defined in [terraform.tfvars](terraform.tfvars.example)
Expand Down
38 changes: 22 additions & 16 deletions aws/infrastructure.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Configure the AWS Provider
provider "aws" {
version = "~> 2.7"
version = "~> 3.11.0"
region = var.aws_region
}

terraform {
required_version = ">= 0.13"
}

data "aws_vpc" "current-vpc" {
count = var.vpc_id != "" ? 1 : 0
id = var.vpc_id
Expand All @@ -18,6 +22,8 @@ data "aws_internet_gateway" "current-gateway" {
}

locals {
deployment_name = var.deployment_name != "" ? var.deployment_name : terraform.workspace

vpc_id = var.vpc_id == "" ? aws_vpc.vpc.0.id : var.vpc_id
internet_gateway = var.vpc_id == "" ? aws_internet_gateway.igw.0.id : data.aws_internet_gateway.current-gateway.0.internet_gateway_id
security_group_id = var.security_group_id != "" ? var.security_group_id : aws_security_group.secgroup.0.id
Expand All @@ -41,18 +47,18 @@ locals {
# It will be created for netweaver only when drbd is disabled
resource "aws_efs_file_system" "netweaver-efs" {
count = var.netweaver_enabled == true && var.drbd_enabled == false ? 1 : 0
creation_token = "${terraform.workspace}-netweaver-efs"
creation_token = "${local.deployment_name}-netweaver-efs"
performance_mode = var.netweaver_efs_performance_mode

tags = {
Name = "${terraform.workspace}-efs"
Name = "${local.deployment_name}-efs"
}
}

# AWS key pair
resource "aws_key_pair" "key-pair" {
key_name = "${terraform.workspace} - terraform"
public_key = file(var.public_key_location)
key_name = "${local.deployment_name} - terraform"
public_key = module.common_variables.configuration["public_key"]
}

# AWS availability zones
Expand All @@ -68,8 +74,8 @@ resource "aws_vpc" "vpc" {
enable_dns_support = true

tags = {
Name = "${terraform.workspace}-vpc"
Workspace = terraform.workspace
Name = "${local.deployment_name}-vpc"
Workspace = local.deployment_name
}
}

Expand All @@ -78,8 +84,8 @@ resource "aws_internet_gateway" "igw" {
vpc_id = local.vpc_id

tags = {
Name = "${terraform.workspace}-igw"
Workspace = terraform.workspace
Name = "${local.deployment_name}-igw"
Workspace = local.deployment_name
}
}

Expand All @@ -89,17 +95,17 @@ resource "aws_subnet" "infra-subnet" {
availability_zone = element(data.aws_availability_zones.available.names, 0)

tags = {
Name = "${terraform.workspace}-infra-subnet"
Workspace = terraform.workspace
Name = "${local.deployment_name}-infra-subnet"
Workspace = local.deployment_name
}
}

resource "aws_route_table" "route-table" {
vpc_id = local.vpc_id

tags = {
Name = "${terraform.workspace}-hana-route-table"
Workspace = terraform.workspace
Name = "${local.deployment_name}-hana-route-table"
Workspace = local.deployment_name
}
}

Expand All @@ -121,12 +127,12 @@ locals {

resource "aws_security_group" "secgroup" {
count = local.create_security_group
name = "${terraform.workspace}-sg"
name = "${local.deployment_name}-sg"
vpc_id = local.vpc_id

tags = {
Name = "${terraform.workspace}-sg"
Workspace = terraform.workspace
Name = "${local.deployment_name}-sg"
Workspace = local.deployment_name
}
}

Expand Down
Loading

0 comments on commit 8a36dac

Please sign in to comment.