Skip to content

Commit

Permalink
Remove not used terraform variables about registration (#309)
Browse files Browse the repository at this point in the history
Remove not used terraform variables about registration. All of them are about
configurations now managed by Ansible, like registration and SID.
  • Loading branch information
mpagot authored Jan 22, 2025
1 parent f09aa15 commit dfc8f86
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 350 deletions.
2 changes: 1 addition & 1 deletion terraform/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Internally to the subnet, all traffic is allowed.

By default, this configuration creates 3 instances in AWS: one for support services (mainly iSCSI as most other services - DHCP, NTP, etc - are provided by Amazon) and 2 cluster nodes, but this can be changed to deploy more cluster nodes as needed.

Once the infrastructure is created by Terraform, the servers are provisioned with Ansible.
Once the infrastructure is created by Terraform, the servers can be provisioned with Ansible.

## Customization

Expand Down
45 changes: 19 additions & 26 deletions terraform/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,12 @@ module "common_variables" {
provider_type = "aws"
deployment_name = local.deployment_name
deployment_name_in_hostname = var.deployment_name_in_hostname
reg_code = var.reg_code
reg_email = var.reg_email
reg_additional_modules = var.reg_additional_modules
additional_packages = var.additional_packages
public_key = var.public_key
authorized_keys = var.authorized_keys
authorized_user = var.admin_user
monitoring_enabled = var.monitoring_enabled
monitoring_srv_ip = var.monitoring_enabled ? local.monitoring_ip : ""
hana_hwcct = var.hwcct
hana_sid = var.hana_sid
hana_instance_number = var.hana_instance_number
hana_cost_optimized_sid = var.hana_cost_optimized_sid
hana_cost_optimized_instance_number = var.hana_cost_optimized_instance_number
hana_primary_site = var.hana_primary_site
hana_secondary_site = var.hana_secondary_site
Expand Down Expand Up @@ -104,7 +97,6 @@ module "common_variables" {
netweaver_nfs_share = var.drbd_enabled ? "${local.drbd_cluster_vip}:/${var.netweaver_sid}" : var.netweaver_nfs_share
netweaver_sapmnt_path = var.netweaver_sapmnt_path
netweaver_hana_ip = var.hana_ha_enabled ? local.hana_cluster_vip : element(local.hana_ips, 0)
netweaver_hana_sid = var.hana_sid
netweaver_hana_instance_number = var.hana_instance_number
netweaver_ha_enabled = var.netweaver_ha_enabled
netweaver_cluster_vip_mechanism = "route"
Expand Down Expand Up @@ -152,24 +144,6 @@ module "drbd_node" {
nfs_export_name = var.netweaver_sid
}

module "iscsi_server" {
source = "./modules/iscsi_server"
common_variables = module.common_variables.configuration
name = var.iscsi_name
network_domain = var.iscsi_network_domain == "" ? var.network_domain : var.iscsi_network_domain
iscsi_count = local.iscsi_enabled == true ? var.iscsi_count : 0
availability_zones = data.aws_availability_zones.available.names
subnet_ids = aws_subnet.infra-subnet.*.id
os_image = local.iscsi_os_image
os_owner = local.iscsi_os_owner
vm_size = var.iscsi_instancetype
key_name = aws_key_pair.key-pair.key_name
security_group_id = local.security_group_id
host_ips = local.iscsi_ips
lun_count = var.iscsi_lun_count
iscsi_disk_size = var.iscsi_disk_size
}

module "netweaver_node" {
source = "./modules/netweaver_node"
common_variables = module.common_variables.configuration
Expand Down Expand Up @@ -236,3 +210,22 @@ module "monitoring" {
subnet_ids = aws_subnet.infra-subnet.*.id
timezone = var.timezone
}

module "iscsi_server" {
source = "./modules/iscsi_server"
common_variables = module.common_variables.configuration
name = var.iscsi_name
network_domain = var.iscsi_network_domain == "" ? var.network_domain : var.iscsi_network_domain
iscsi_count = local.iscsi_enabled == true ? var.iscsi_count : 0
availability_zones = data.aws_availability_zones.available.names
subnet_ids = aws_subnet.infra-subnet.*.id
os_image = local.iscsi_os_image
os_owner = local.iscsi_os_owner
vm_size = var.iscsi_instancetype
key_name = aws_key_pair.key-pair.key_name
security_group_id = local.security_group_id
host_ips = local.iscsi_ips
lun_count = var.iscsi_lun_count
iscsi_disk_size = var.iscsi_disk_size
}

5 changes: 0 additions & 5 deletions terraform/aws/modules/hana_node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,3 @@ variable "iscsi_srv_ip" {
description = "iscsi server address"
type = string
}

variable "reg_code" {
description = "If informed, register the product using SUSEConnect"
default = ""
}
18 changes: 0 additions & 18 deletions terraform/aws/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@ deployment_name = "mydeployment"
# aws-cli credentials file. Located on ~/.aws/credentials on Linux, MacOS or Unix or at C:\Users\USERNAME\.aws\credentials on Windows
#aws_credentials = "~/.aws/credentials"

# Supply SCC registration code to register BYOS images to SCC. Keep it commented if using PAYG images or if registration of BYOS
# images is not required
#reg_code = "<<REG_CODE>>"
#reg_email = "<<your email>>"

# To add additional modules from SCC. None of them is needed by default
#reg_additional_modules = {
# "sle-module-adv-systems-management/12/x86_64" = ""
# "sle-module-containers/12/x86_64" = ""
# "sle-ha-geo/12.4/x86_64" = "<<REG_CODE>>"
#}

# Default os_image and os_owner. These values are not used if the specific values are set (e.g.: hana_os_image)
# BYOS example with sles4sap 15 sp3 (this value is a pattern, it will select the latest version that matches this name)
#os_image = "suse-sles-sap-15-sp3-byos"
Expand Down Expand Up @@ -84,10 +72,6 @@ public_key = "/home/myuser/.ssh/id_rsa.pub"
# true or false (default)
#offline_mode = false

# Execute HANA Hardware Configuration Check Tool to bench filesystems
# true or false (default)
#hwcct = false

#########################
# HANA machines variables
#########################
Expand Down Expand Up @@ -145,8 +129,6 @@ hana_count = "2"
# HANA instance configuration
# Find some references about the variables in:
# https://help.sap.com
# HANA instance system identifier. The system identifier must be composed by 3 uppercase chars/digits string starting always with a character (there are some restricted options).
#hana_sid = "PRD"
# HANA instance number. It's composed of 2 integers string
#hana_instance_number = "00"
# HANA primary site name. Only used if HANA's system replication feature is enabled (hana_ha_enabled to true)
Expand Down
51 changes: 1 addition & 50 deletions terraform/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ variable "admin_user" {
}

# Deployment variables

variable "deployment_name" {
description = "Suffix string added to some of the infrastructure resources names. If it is not provided, the terraform workspace string is used as suffix"
type = string
Expand Down Expand Up @@ -124,37 +123,6 @@ variable "timezone" {
default = "Europe/Berlin"
}

variable "reg_code" {
description = "If informed, register the product using SUSEConnect"
type = string
default = ""
}

variable "reg_email" {
description = "Email used for the registration"
default = ""
}

# The module format must follow SUSEConnect convention:
# <module_name>/<product_version>/<architecture>
# Example: Suggested modules for SLES for SAP 15
# - sle-module-basesystem/15/x86_64
# - sle-module-desktop-applications/15/x86_64
# - sle-module-server-applications/15/x86_64
# - sle-ha/15/x86_64 (Need the same regcode as SLES for SAP)
# - sle-module-sap-applications/15/x86_64

variable "reg_additional_modules" {
description = "Map of the modules to be registered. Module name = Regcode, when needed."
type = map(string)
default = {}
}

variable "additional_packages" {
description = "Extra packages to be installed"
default = []
}

# Hana related variables
variable "hana_name" {
description = "hostname, without the domain part"
Expand Down Expand Up @@ -228,18 +196,6 @@ variable "hana_fstype" {
default = "xfs"
}

variable "hana_sid" {
description = "System identifier of the HANA system. It must be a 3 characters string (check the restrictions in the SAP documentation pages). Examples: PRD, HA1"
type = string
default = "PRD"
}

variable "hana_cost_optimized_sid" {
description = "System identifier of the HANA cost-optimized system. It must be a 3 characters string (check the restrictions in the SAP documentation pages). Examples: PRD, HA1"
type = string
default = "QAS"
}

variable "hana_instance_number" {
description = "Instance number of the HANA system. It must be a 2 digits string. Examples: 00, 01, 10"
type = string
Expand Down Expand Up @@ -775,13 +731,8 @@ variable "netweaver_shared_storage_type" {

# Testing and QA variables

# Execute HANA Hardware Configuration Check Tool to bench filesystems.
# TODO: Execute HANA Hardware Configuration Check Tool to bench filesystems.
# The test takes several hours. See results in /root/hwcct_out
variable "hwcct" {
description = "Execute HANA Hardware Configuration Check Tool to bench filesystems"
type = bool
default = false
}

variable "hana_remote_python" {
description = "Remote python interpreter that Ansible will use on HANA nodes"
Expand Down
7 changes: 0 additions & 7 deletions terraform/azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,13 @@ module "common_variables" {
provider_type = "azure"
deployment_name = local.deployment_name
deployment_name_in_hostname = var.deployment_name_in_hostname
reg_code = var.reg_code
reg_email = var.reg_email
reg_additional_modules = var.reg_additional_modules
additional_packages = var.additional_packages
public_key = var.public_key
authorized_keys = var.authorized_keys
authorized_user = var.admin_user
monitoring_enabled = var.monitoring_enabled
monitoring_srv_ip = var.monitoring_enabled ? local.monitoring_ip : ""
hana_hwcct = var.hwcct
hana_sid = var.hana_sid
hana_instance_number = var.hana_instance_number
hana_cost_optimized_sid = var.hana_cost_optimized_sid
hana_cost_optimized_instance_number = var.hana_cost_optimized_instance_number
hana_primary_site = var.hana_primary_site
hana_secondary_site = var.hana_secondary_site
Expand Down Expand Up @@ -105,7 +99,6 @@ module "common_variables" {
netweaver_nfs_share = var.drbd_enabled ? "${local.drbd_cluster_vip}:/${var.netweaver_sid}" : var.netweaver_nfs_share
netweaver_sapmnt_path = var.netweaver_sapmnt_path
netweaver_hana_ip = var.hana_ha_enabled ? local.hana_cluster_vip : element(local.hana_ips, 0)
netweaver_hana_sid = var.hana_sid
netweaver_hana_instance_number = var.hana_instance_number
netweaver_ha_enabled = var.netweaver_ha_enabled
netweaver_cluster_vip_mechanism = "load-balancer"
Expand Down
14 changes: 0 additions & 14 deletions terraform/azure/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ subnet_address_range = "10.10.1.0/24"
# The name must be unique among different deployments
deployment_name = "mydeployment"

# If BYOS images are used in the deployment, SCC registration code is required. Set `reg_code` and `reg_email` variables below
# By default, all the images are PAYG, so these next parameters are not needed
#reg_code = "<<REG_CODE>>"
#reg_email = "<<your email>>"

# To add additional modules from SCC. None of them is needed by default
#reg_additional_modules = {
# "sle-module-adv-systems-management/12/x86_64" = ""
# "sle-module-containers/12/x86_64" = ""
# "sle-ha-geo/12.4/x86_64" = "<<REG_CODE>>"
#}

# Default os_image. This value is not used if the specific values are set (e.g.: hana_os_image)
# Run the next command to get the possible options and use the 4th column value (version can be changed by `latest`)
# az vm image list --output table --publisher SUSE --all
Expand Down Expand Up @@ -198,8 +186,6 @@ hana_count = "2"
# HANA instance configuration
# Find some references about the variables in:
# https://help.sap.com
# HANA instance system identifier. The system identifier must be composed by 3 uppercase chars/digits string starting always with a character (there are some restricted options).
#hana_sid = "PRD"
# HANA instance number. It's composed of 2 integers string
#hana_instance_number = "00"

Expand Down
43 changes: 0 additions & 43 deletions terraform/azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -131,37 +131,6 @@ variable "timezone" {
default = "Europe/Berlin"
}

variable "reg_code" {
description = "If informed, register the product using SUSEConnect"
type = string
default = ""
}

variable "reg_email" {
description = "Email used for the registration"
default = ""
}

# The module format must follow SUSEConnect convention:
# <module_name>/<product_version>/<architecture>
# Example: Suggested modules for SLES for SAP 15
# - sle-module-basesystem/15/x86_64
# - sle-module-desktop-applications/15/x86_64
# - sle-module-server-applications/15/x86_64
# - sle-ha/15/x86_64 (Need the same regcode as SLES for SAP)
# - sle-module-sap-applications/15/x86_64

variable "reg_additional_modules" {
description = "Map of the modules to be registered. Module name = Regcode, when needed."
type = map(string)
default = {}
}

variable "additional_packages" {
description = "Extra packages to be installed"
default = []
}

# Hana related variables
variable "hana_name" {
description = "hostname, without the domain part"
Expand Down Expand Up @@ -281,18 +250,6 @@ variable "hana_fstype" {
default = "xfs"
}

variable "hana_sid" {
description = "System identifier of the HANA system. It must be a 3 characters string (check the restrictions in the SAP documentation pages). Examples: PRD, HA1"
type = string
default = "PRD"
}

variable "hana_cost_optimized_sid" {
description = "System identifier of the HANA cost-optimized system. It must be a 3 characters string (check the restrictions in the SAP documentation pages). Examples: PRD, HA1"
type = string
default = "QAS"
}

variable "hana_instance_number" {
description = "Instance number of the HANA system. It must be a 2 digits string. Examples: 00, 01, 10"
type = string
Expand Down
7 changes: 0 additions & 7 deletions terraform/gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,14 @@ module "common_variables" {
region = var.region
deployment_name = local.deployment_name
deployment_name_in_hostname = var.deployment_name_in_hostname
reg_code = var.reg_code
reg_email = var.reg_email
reg_additional_modules = var.reg_additional_modules
additional_packages = var.additional_packages
public_key = var.public_key
authorized_keys = var.authorized_keys
authorized_user = var.admin_user

monitoring_enabled = var.monitoring_enabled
monitoring_srv_ip = var.monitoring_enabled ? local.monitoring_srv_ip : ""
hana_hwcct = var.hwcct
hana_sid = var.hana_sid
hana_instance_number = var.hana_instance_number
hana_cost_optimized_sid = var.hana_cost_optimized_sid
hana_cost_optimized_instance_number = var.hana_cost_optimized_instance_number
hana_primary_site = var.hana_primary_site
hana_secondary_site = var.hana_secondary_site
Expand Down Expand Up @@ -115,7 +109,6 @@ module "common_variables" {
netweaver_nfs_share = var.drbd_enabled ? "${local.drbd_cluster_vip}:/${var.netweaver_sid}" : var.netweaver_nfs_share
netweaver_sapmnt_path = var.netweaver_sapmnt_path
netweaver_hana_ip = var.hana_ha_enabled ? local.hana_cluster_vip : element(local.hana_ips, 0)
netweaver_hana_sid = var.hana_sid
netweaver_hana_instance_number = var.hana_instance_number
netweaver_ha_enabled = var.netweaver_ha_enabled
netweaver_cluster_vip_mechanism = var.netweaver_cluster_vip_mechanism
Expand Down
13 changes: 0 additions & 13 deletions terraform/gcp/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ deployment_name = "mydeployment"
# Add the "deployment_name" as a prefix to the hostname.
#deployment_name_in_hostname = true

# If BYOS images are used in the deployment, SCC registration code is required. Set `reg_code` and `reg_email` variables below
# By default, all the images are PAYG, so these next parameters are not needed
#reg_code = "<<REG_CODE>>"
#reg_email = "<<your email>>"

# To add additional modules from SCC. None of them is needed by default
#reg_additional_modules = {
# "sle-module-adv-systems-management/12/x86_64" = ""
# "sle-module-containers/12/x86_64" = ""
# "sle-ha-geo/12.4/x86_64" = "<<REG_CODE>>"
#}

# Default os_image. This value is not used if the specific values are set (e.g.: hana_os_image)
# If `gcloud` utility is available in your local machine, the next command shows some of the available options
# gcloud compute images list --standard-images --filter=sles
Expand Down Expand Up @@ -154,7 +142,6 @@ machine_type = "n1-highmem-32"
# HANA instance configuration
# Find some references about the variables in:
# https://help.sap.com
# HANA instance system identifier. The system identifier must be composed by 3 uppercase chars/digits string starting always with a character (there are some restricted options).
#hana_sid = "PRD"
# HANA instance number. It's composed of 2 integers string
#hana_instance_number = "00"
Expand Down
Loading

0 comments on commit dfc8f86

Please sign in to comment.