Skip to content

Commit

Permalink
v1.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI User committed Nov 28, 2023
1 parent 9d1fd88 commit dbceedf
Show file tree
Hide file tree
Showing 16 changed files with 178 additions and 86 deletions.
134 changes: 82 additions & 52 deletions README.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[defaults]
remote_user = root
host_key_checking = False
log_path = /var/log/ansible.log
callback_whitelist = profile_tasks
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s
transfer_method = smart
pipelining = True

19 changes: 13 additions & 6 deletions input.auto.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ ID_RSA_FILE_PATH = "ansible/id_rsa"
# It must contain the relative or absoute path from your Bastion.
# Examples: "ansible/id_rsa_s4hana" , "~/.ssh/id_rsa_s4hana" , "/root/.ssh/id_rsa".

##########################################################
# Activity Tracker variables:
##########################################################

ATR_NAME = ""
# The name of an existent Activity Tracker instance, in the same region chosen for SAP system deployment.
# Example: ATR_NAME="Activity-Tracker-SAP-eu-de"

##########################################################
# DB VSI variables:
Expand All @@ -53,10 +60,10 @@ DB_PROFILE = "mx2-16x128"
# For more information about supported DB/OS and IBM Gen 2 Virtual Server Instances (VSI), check [SAP Note 2927211: SAP Applications on IBM Virtual Private Cloud](https://launchpad.support.sap.com/#/notes/2927211)
# Default value: "mx2-16x128"

DB_IMAGE = "ibm-redhat-8-6-amd64-sap-hana-2"
# OS image for DB VSI. Supported OS images for DB VSIs: ibm-sles-15-3-amd64-sap-hana-2, ibm-sles-15-4-amd64-sap-hana-3, ibm-redhat-8-4-amd64-sap-hana-2, ibm-redhat-8-6-amd64-sap-hana-2.
DB_IMAGE = "ibm-redhat-8-6-amd64-sap-hana-4"
# OS image for DB VSI. Supported OS images for DB VSIs: ibm-sles-15-3-amd64-sap-hana-8, ibm-sles-15-4-amd64-sap-hana-5, ibm-redhat-8-4-amd64-sap-hana-7, ibm-redhat-8-6-amd64-sap-hana-4.
# The list of available VPC Operating Systems supported by SAP: SAP note '2927211 - SAP Applications on IBM Virtual Private Cloud (VPC) Infrastructure environment' https://launchpad.support.sap.com/#/notes/2927211; The list of all available OS images: https://cloud.ibm.com/docs/vpc?topic=vpc-about-images
# Example: DB_IMAGE = "ibm-sles-15-4-amd64-sap-hana-3"
# Example: DB_IMAGE = "ibm-sles-15-4-amd64-sap-hana-5"

##########################################################
# SAP APP VSI variables:
Expand All @@ -69,10 +76,10 @@ APP_HOSTNAME = ""
APP_PROFILE = "bx2-4x16"
# The APP VSI profile. Supported profiles: bx2-4x16. The list of available profiles: https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui

APP_IMAGE = "ibm-redhat-8-6-amd64-sap-applications-2"
# OS image for SAP APP VSI. Supported OS images for APP VSIs: ibm-sles-15-3-amd64-sap-applications-2, ibm-sles-15-4-amd64-sap-applications-4, ibm-redhat-8-4-amd64-sap-applications-2, ibm-redhat-8-6-amd64-sap-applications-3.
APP_IMAGE = "ibm-redhat-8-6-amd64-sap-applications-4"
# OS image for SAP APP VSI. Supported OS images for APP VSIs: ibm-sles-15-3-amd64-sap-applications-9, ibm-sles-15-4-amd64-sap-applications-6, ibm-redhat-8-4-amd64-sap-applications-7, ibm-redhat-8-6-amd64-sap-applications-4.
# The list of available VPC Operating Systems supported by SAP: SAP note '2927211 - SAP Applications on IBM Virtual Private Cloud (VPC) Infrastructure environment' https://launchpad.support.sap.com/#/notes/2927211; The list of all available OS images: https://cloud.ibm.com/docs/vpc?topic=vpc-about-images
# Example: APP-IMAGE = "ibm-redhat-8-6-amd64-sap-applications-2"
# Example: APP-IMAGE = "ibm-sles-15-4-amd64-sap-applications-6"

##########################################################
# SAP HANA configuration
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ module "vpc-subnet" {

module "db-vsi" {
source = "./modules/db-vsi"
depends_on = [ module.precheck-ssh-exec ]
# depends_on = [ module.precheck-ssh-exec ]
depends_on = [ module.vpc-subnet ]
ZONE = var.ZONE
VPC = var.VPC
SECURITY_GROUP = var.SECURITY_GROUP
Expand Down
4 changes: 2 additions & 2 deletions modules/ansible-exec/cli/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.41.1"
version = ">= 1.57.0"
}
}
required_version = ">= 1.3.6"
required_version = ">= 1.5.7"
}

4 changes: 2 additions & 2 deletions modules/ansible-exec/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.41.1"
version = ">= 1.57.0"
}
}
required_version = ">= 1.3.6"
required_version = ">= 1.5.7"
}

4 changes: 2 additions & 2 deletions modules/app-vsi/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.41.1"
version = ">= 1.57.0"
}
}
required_version = ">= 1.3.6"
required_version = ">= 1.5.7"
}

1 change: 1 addition & 0 deletions modules/app-vsi/vsi.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ data "ibm_resource_group" "group" {
}

resource "ibm_is_instance" "vsi" {
tags = [ "wes-sap-automation" ]
vpc = data.ibm_is_vpc.vpc.id
zone = var.ZONE
resource_group = data.ibm_resource_group.group.id
Expand Down
4 changes: 2 additions & 2 deletions modules/db-vsi/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.41.1"
version = ">= 1.57.0"
}
}
required_version = ">= 1.3.6"
required_version = ">= 1.5.7"
}

1 change: 1 addition & 0 deletions modules/db-vsi/vsi.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ data "ibm_resource_group" "group" {
}

resource "ibm_is_instance" "vsi" {
tags = [ "wes-sap-automation" ]
vpc = data.ibm_is_vpc.vpc.id
zone = var.ZONE
resource_group = data.ibm_resource_group.group.id
Expand Down
4 changes: 2 additions & 2 deletions modules/pre-init/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.41.1"
version = ">= 1.57.0"
}
}
required_version = ">= 1.3.6"
required_version = ">= 1.5.7"
}

4 changes: 2 additions & 2 deletions modules/precheck-ssh-exec/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.41.1"
version = ">= 1.57.0"
}
}
required_version = ">= 1.3.6"
required_version = ">= 1.5.7"
}

4 changes: 2 additions & 2 deletions modules/vpc/subnet/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.41.1"
version = ">= 1.57.0"
}
}
required_version = ">= 1.3.6"
required_version = ">= 1.5.7"
}

6 changes: 6 additions & 0 deletions output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ output "APP_PRIVATE_IP" {
output "VPC" {
value = var.VPC
}

output "ATR_INSTANCE_NAME" {
description = "Activity Tracker instance name."
value = var.ATR_NAME
}

61 changes: 50 additions & 11 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
############################################################
# The variables and data sources used in VPC infra Modules.
############################################################

variable "PRIVATE_SSH_KEY" {
type = string
description = "Input id_rsa private key content (Sensitive* value)."
description = "The id_rsa private key content in OpenSSH format. This private key should be used only during the terraform provisioning and it is recommended to be changed after the SAP deployment."
nullable = false
validation {
condition = length(var.PRIVATE_SSH_KEY) >= 64 && var.PRIVATE_SSH_KEY != null && length(var.PRIVATE_SSH_KEY) != 0 || contains(["n.a"], var.PRIVATE_SSH_KEY )
error_message = "The content for private_ssh_key variable must be completed in OpenSSH format."
error_message = "The content for PRIVATE_SSH_KEY variable must be completed in OpenSSH format."
}
}

variable "ID_RSA_FILE_PATH" {
default = "ansible/id_rsa"
nullable = false
description = "The file path for private_ssh_key will be automatically generated by default. If it is changed, it must contain the relative path from git repo folders. Examples: ansible/id_rsa_s4hana, ~/.ssh/id_rsa_s4hana , /root/.ssh/id_rsa"
description = "The file path for ID_RSA_FILE_PATH will be automatically generated by default. If it is changed, it must contain the relative path from git repo folders. Examples: ansible/id_rsa_s4hana, ~/.ssh/id_rsa_s4hana , /root/.ssh/id_rsa"
}


variable "SSH_KEYS" {
type = list(string)
description = "List of SSH Keys UUIDs that are allowed to SSH as root to the VSI. Can contain one or more IDs. The list of SSH Keys is available here: https://cloud.ibm.com/vpc-ext/compute/sshKeys."
Expand All @@ -26,7 +29,7 @@ variable "SSH_KEYS" {

variable "BASTION_FLOATING_IP" {
type = string
description = "Input the FLOATING IP from the Bastion Server."
description = "The BASTION FLOATING IP. It can be copied from the Bastion Server Deployment \"OUTPUTS\" at the end of \"Apply plan successful\" message."
nullable = false
validation {
condition = can(regex("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",var.BASTION_FLOATING_IP)) || contains(["localhost"], var.BASTION_FLOATING_IP ) && var.BASTION_FLOATING_IP!= null
Expand Down Expand Up @@ -106,8 +109,8 @@ variable "DB_PROFILE" {

variable "DB_IMAGE" {
type = string
description = "The OS image used for HANA VSI (See Obs*). A list of images is available here: https://cloud.ibm.com/docs/vpc?topic=vpc-about-images."
default = "ibm-redhat-8-6-amd64-sap-hana-2"
description = "The OS image used for HANA VSI. A list of images is available here: https://cloud.ibm.com/docs/vpc?topic=vpc-about-images."
default = "ibm-redhat-8-6-amd64-sap-hana-4"
validation {
condition = length(regexall("^(ibm-redhat-8-(4|6)-amd64-sap-hana|ibm-sles-15-(3|4)-amd64-sap-hana)-[0-9][0-9]*", var.DB_IMAGE)) > 0
error_message = "The OS SAP DB_IMAGE must be one of \"ibm-sles-15-3-amd64-sap-hana-x\", \"ibm-sles-15-4-amd64-sap-hana-x\", \"ibm-redhat-8-4-amd64-sap-hana-x\" or \"ibm-redhat-8-6-amd64-sap-hana-x\"."
Expand All @@ -131,8 +134,8 @@ variable "APP_PROFILE" {

variable "APP_IMAGE" {
type = string
description = "The OS image used for SAP Application VSI (See Obs*). A list of images is available here: https://cloud.ibm.com/docs/vpc?topic=vpc-about-images."
default = "ibm-redhat-8-6-amd64-sap-applications-2"
description = "The OS image used for SAP Application VSI. A list of images is available here: https://cloud.ibm.com/docs/vpc?topic=vpc-about-images."
default = "ibm-redhat-8-6-amd64-sap-applications-4"
validation {
condition = length(regexall("^(ibm-redhat-8-(4|6)-amd64-sap-applications|ibm-sles-15-(3|4)-amd64-sap-applications)-[0-9][0-9]*", var.APP_IMAGE)) > 0
error_message = "The OS SAP APP_IMAGE must be one of \"ibm-sles-15-3-amd64-sap-applications-x\", \"ibm-sles-15-4-amd64-sap-applications-x\", \"ibm-redhat-8-4-amd64-sap-applications-x\" or \"ibm-redhat-8-6-amd64-sap-applications-x\"."
Expand All @@ -149,6 +152,19 @@ data "ibm_is_instance" "app-vsi" {
name = var.APP_HOSTNAME
}

##############################################################
# The variables used in Activity Tracker service.
##############################################################

variable "ATR_NAME" {
type = string
description = "The name of the EXISTING Activity Tracker instance, in the same region as HANA VSI. The list of available Activity Tracker is available here: https://cloud.ibm.com/observe/activitytracker"
default = ""
}

##############################################################
# The variables and data sources used in SAP Ansible Modules.
##############################################################

variable "HANA_SID" {
type = string
Expand Down Expand Up @@ -202,7 +218,7 @@ variable "HANA_COMPONENTS" {

variable "KIT_SAPHANA_FILE" {
type = string
description = "Path to SAP HANA ZIP file (See Obs*). As downloaded from SAP Support Portal."
description = "Path to SAP HANA ZIP file. As downloaded from SAP Support Portal."
default = "/storage/HANADB/51055299.ZIP"
}

Expand All @@ -212,7 +228,7 @@ variable "SAP_SID" {
default = "NWD"
validation {
condition = length(regexall("^[a-zA-Z][a-zA-Z0-9][a-zA-Z0-9]$", var.SAP_SID)) > 0 && !contains(["ADD", "ALL", "AMD", "AND", "ANY", "ARE", "ASC", "AUX", "AVG", "BIT", "CDC", "COM", "CON", "DBA", "END", "EPS", "FOR", "GET", "GID", "IBM", "INT", "KEY", "LOG", "LPT", "MAP", "MAX", "MIN", "MON", "NIX", "NOT", "NUL", "OFF", "OLD", "OMS", "OUT", "PAD", "PRN", "RAW", "REF", "ROW", "SAP", "SET", "SGA", "SHG", "SID", "SQL", "SUM", "SYS", "TMP", "TOP", "UID", "USE", "USR", "VAR"], var.SAP_SID)
error_message = "The sap_sid is not valid."
error_message = "The SAP_SID is not valid."
}
}

Expand Down Expand Up @@ -309,3 +325,26 @@ variable "KIT_S4HANA_EXPORT" {
description = "Path to S/4HANA Installation Export dir. The archives downloaded from SAP Support Portal should be present in this path."
default = "/storage/S4HANA/export"
}

# ATR variables and conditions
locals {
ATR_ENABLE = true
}

resource "null_resource" "check_atr_name" {
count = local.ATR_ENABLE == true ? 1 : 0
lifecycle {
precondition {
condition = var.ATR_NAME != "" && var.ATR_NAME != null
error_message = "The name of an EXISTENT Activity Tracker in the same region must be specified."
}
}
}

data "ibm_resource_instance" "activity_tracker" {
count = local.ATR_ENABLE == true ? 1 : 0
name = var.ATR_NAME
location = var.REGION
service = "logdnaat"
}

4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.41.1"
version = ">= 1.57.0"
}
}
required_version = ">= 1.3.6"
required_version = ">= 1.5.7"
}

0 comments on commit dbceedf

Please sign in to comment.