From 426a36caacf5ed8ade86faf5f3efa3d668c8042d Mon Sep 17 00:00:00 2001
From: Eesaan Atluri <atlurie@uab.edu>
Date: Fri, 13 Sep 2019 14:19:16 -0500
Subject: [PATCH] Replace ohpc IP in /etc/hosts from the img for scontrol to
 work.

---
 ohpc-instance/main.tf | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ohpc-instance/main.tf b/ohpc-instance/main.tf
index 746a7e5..cf39081 100644
--- a/ohpc-instance/main.tf
+++ b/ohpc-instance/main.tf
@@ -28,6 +28,15 @@ resource "openstack_compute_instance_v2" "ohpc" {
   flavor_name     = var.flavor
   key_pair        = var.key_pair
   security_groups = ["default"]
+  user_data = <<-EOF
+     #cloud-config
+     write_files:
+     - content: |
+         10.1.1.10 ohpc ohpc.novalocal
+       owner: centos:centos
+       path: /etc/hosts
+       permissions: 0644
+     EOF
 
 # defines the networks of the instance
   network {
-- 
GitLab