aboutsummaryrefslogtreecommitdiffstats
path: root/terragrunt/openlab/RegionOne/stage/compute/nfsserver
diff options
context:
space:
mode:
authoryoonsoonjahng <yoonsoon.jahng@yoppworks.com>2020-09-10 12:12:40 -0400
committerNeil Derraugh <neil.derraugh@yoppworks.com>2020-09-14 21:25:17 +0000
commitc0987507209cdfa232b5113dbb386bfc3cf87805 (patch)
tree8214fa05f75253a10f01d06dfcb99ae788ddc408 /terragrunt/openlab/RegionOne/stage/compute/nfsserver
parent8e49e9261a4aa68670937f88d44b26a129ec2b4f (diff)
Added terragrunt script pulling integration/terraform.
Issue-ID: INT-1719 Change-Id: I0282f010d07e0a1cc1259133f4237ea7e1d72126 Signed-off-by: yoonsoonjahng <yoonsoon.jahng@yoppworks.com>
Diffstat (limited to 'terragrunt/openlab/RegionOne/stage/compute/nfsserver')
-rw-r--r--terragrunt/openlab/RegionOne/stage/compute/nfsserver/nfs-server.sh20
-rw-r--r--terragrunt/openlab/RegionOne/stage/compute/nfsserver/terragrunt.hcl35
2 files changed, 55 insertions, 0 deletions
diff --git a/terragrunt/openlab/RegionOne/stage/compute/nfsserver/nfs-server.sh b/terragrunt/openlab/RegionOne/stage/compute/nfsserver/nfs-server.sh
new file mode 100644
index 0000000..127a554
--- /dev/null
+++ b/terragrunt/openlab/RegionOne/stage/compute/nfsserver/nfs-server.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+export DEBIAN_FRONTEND=noninteractive
+
+apt-get update
+
+IP_ADDR=`ip address |grep ens|grep inet|awk '{print $2}'| awk -F / '{print $1}'`
+HOSTNAME=`hostname`
+
+echo "$IP_ADDR $HOSTNAME" >> /etc/hosts
+
+sudo apt-get install make -y
+
+# nfs server
+sudo apt-get install nfs-kernel-server -y
+
+sudo mkdir -p /nfs_share
+sudo chown nobody:nogroup /nfs_share/
+
+exit 0 \ No newline at end of file
diff --git a/terragrunt/openlab/RegionOne/stage/compute/nfsserver/terragrunt.hcl b/terragrunt/openlab/RegionOne/stage/compute/nfsserver/terragrunt.hcl
new file mode 100644
index 0000000..4e7f83f
--- /dev/null
+++ b/terragrunt/openlab/RegionOne/stage/compute/nfsserver/terragrunt.hcl
@@ -0,0 +1,35 @@
+locals {
+ # Automatically load account-level variables
+ region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
+ env_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
+
+ region = local.region_vars.locals.region
+ environment = local.env_vars.locals.environment
+ network = local.env_vars.locals.network
+}
+
+terraform {
+ source = "git::https://gerrit.onap.org/r/integration/terraform/openlab/modules/openstack/compute"
+}
+
+include {
+ path = find_in_parent_folders()
+}
+
+dependencies {
+ paths = ["../../keypair", "../../network", "../../securitygroup"]
+}
+
+inputs = {
+
+ environment = local.environment
+ cluster_name = "${local.region}-${local.environment}"
+
+ node_name = "nfsserver"
+ image = "ubuntu-18.04"
+ flavor = "m1.xlarge"
+ floating_ip_pool = "external"
+ # Read as File stream
+ user_data = file("nfs-server.sh")
+ node_count = 1
+}