Skip to content

Commit

Permalink
Merge pull request #32 from F5Networks/devel_templatefilefixes
Browse files Browse the repository at this point in the history
adding templatefile fixes
  • Loading branch information
RavinderReddyF5 authored Nov 7, 2022
2 parents 94e7d5e + 4e48031 commit 8a444ea
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
27 changes: 11 additions & 16 deletions examples/bigip_aws_1nic_deploy_custom_runtime_init/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,6 @@ resource "aws_key_pair" "generated_key" {
public_key = tls_private_key.example.public_key_openssh
}

data "template_file" "user_data_vm0" {
template = file("custom_onboard_big.tmpl")
vars = {
bigip_username = "bigipuser"
ssh_keypair = fileexists("~/.ssh/id_rsa.pub") ? file("~/.ssh/id_rsa.pub") : ""
aws_secretmanager_auth = false
bigip_password = "xxxxxx"
INIT_URL = "https://cdn.f5.com/product/cloudsolutions/f5-bigip-runtime-init/v1.2.1/dist/f5-bigip-runtime-init-1.2.1-1.gz.run",
DO_URL = "https://github.com/F5Networks/f5-declarative-onboarding/releases/download/v1.21.0/f5-declarative-onboarding-1.21.0-3.noarch.rpm",
DO_VER = "v1.21.0"
AS3_URL = "https://github.com/F5Networks/f5-appsvcs-extension/releases/download/v3.28.0/f5-appsvcs-3.28.0-3.noarch.rpm",
AS3_VER = "v3.28.0"
}
}

#
# Create BIG-IP
#
Expand All @@ -208,7 +193,17 @@ module "bigip" {
//aws_iam_instance_profile = aws_iam_instance_profile.instance_profile.name
mgmt_subnet_ids = [{ "subnet_id" = aws_subnet.mgmt.id, "public_ip" = true, "private_ip_primary" = "" }]
mgmt_securitygroup_ids = [module.mgmt-network-security-group.security_group_id]
custom_user_data = data.template_file.user_data_vm0.rendered
custom_user_data = templatefile("custom_onboard_big.tmpl", {
bigip_username = "bigipuser"
ssh_keypair = fileexists("~/.ssh/id_rsa.pub") ? file("~/.ssh/id_rsa.pub") : ""
aws_secretmanager_auth = false
bigip_password = "xxxxxx"
INIT_URL = "https://cdn.f5.com/product/cloudsolutions/f5-bigip-runtime-init/v1.2.1/dist/f5-bigip-runtime-init-1.2.1-1.gz.run",
DO_URL = "https://github.com/F5Networks/f5-declarative-onboarding/releases/download/v1.21.0/f5-declarative-onboarding-1.21.0-3.noarch.rpm",
DO_VER = "v1.21.0"
AS3_URL = "https://github.com/F5Networks/f5-appsvcs-extension/releases/download/v3.28.0/f5-appsvcs-3.28.0-3.noarch.rpm",
AS3_VER = "v3.28.0"
})
}

resource "null_resource" "clusterDO" {
Expand Down
6 changes: 3 additions & 3 deletions templates/f5_onboard.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ mkdir -p /config/cloud

cat << 'EOF' > /config/cloud/runtime-init-conf.yaml
---
controls:
extensionInstallDelayInMs: 60000
runtime_parameters:
- name: USER_NAME
type: static
Expand Down Expand Up @@ -189,7 +191,5 @@ bash /var/config/rest/downloads/f5-bigip-runtime-init.gz.run -- '--cloud aws'
# Run
# export F5_BIGIP_RUNTIME_INIT_LOG_LEVEL=silly
f5-bigip-runtime-init --config-file /config/cloud/runtime-init-conf.yaml

sleep 5

sleep 2
f5-bigip-runtime-init --config-file /config/cloud/runtime-init-conf-backup.yaml
10 changes: 5 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,22 @@ variable "internal_securitygroup_ids" {
variable "DO_URL" {
description = "URL to download the BIG-IP Declarative Onboarding module"
type = string
default = "https://github.com/F5Networks/f5-declarative-onboarding/releases/download/v1.32.0/f5-declarative-onboarding-1.32.0-3.noarch.rpm"
default = "https://github.com/F5Networks/f5-declarative-onboarding/releases/download/v1.33.0/f5-declarative-onboarding-1.33.0-7.noarch.rpm"
}
## Please check and update the latest AS3 URL from https://github.com/F5Networks/f5-appsvcs-extension/releases/latest
# always point to a specific version in order to avoid inadvertent configuration inconsistency
variable "AS3_URL" {
description = "URL to download the BIG-IP Application Service Extension 3 (AS3) module"
type = string
default = "https://github.com/F5Networks/f5-appsvcs-extension/releases/download/v3.39.0/f5-appsvcs-3.39.0-7.noarch.rpm"
default = "https://github.com/F5Networks/f5-appsvcs-extension/releases/download/v3.40.0/f5-appsvcs-3.40.0-5.noarch.rpm"
}

## Please check and update the latest TS URL from https://github.com/F5Networks/f5-telemetry-streaming/releases/latest
# always point to a specific version in order to avoid inadvertent configuration inconsistency
variable "TS_URL" {
description = "URL to download the BIG-IP Telemetry Streaming module"
type = string
default = "https://github.com/F5Networks/f5-telemetry-streaming/releases/download/v1.31.0/f5-telemetry-1.31.0-2.noarch.rpm"
default = "https://github.com/F5Networks/f5-telemetry-streaming/releases/download/v1.32.0/f5-telemetry-1.32.0-2.noarch.rpm"
}

## Please check and update the latest Failover Extension URL from https://github.com/F5Networks/f5-cloud-failover-extension/releases/latest
Expand All @@ -148,7 +148,7 @@ variable "CFE_URL" {
variable "FAST_URL" {
description = "URL to download the BIG-IP FAST module"
type = string
default = "https://github.com/F5Networks/f5-appsvcs-templates/releases/download/v1.20.0/f5-appsvcs-templates-1.20.0-1.noarch.rpm"
default = "https://github.com/F5Networks/f5-appsvcs-templates/releases/download/v1.21.0/f5-appsvcs-templates-1.21.0-1.noarch.rpm"
}
## Please check and update the latest runtime init URL from https://github.com/F5Networks/f5-bigip-runtime-init/releases/latest
# always point to a specific version in order to avoid inadvertent configuration inconsistency
Expand Down Expand Up @@ -183,6 +183,6 @@ variable "tags" {

variable "sleep_time" {
type = string
default = "400s"
default = "600s"
description = "The number of seconds/minutes of delay to build into creation of BIG-IP VMs; default is 250. BIG-IP requires a few minutes to complete the onboarding process and this value can be used to delay the processing of dependent Terraform resources."
}

0 comments on commit 8a444ea

Please sign in to comment.