From 851f82ae1622143f641a974ff5d9807aa5704dc7 Mon Sep 17 00:00:00 2001
From: Bo-Chun Louis Chen <louistw@uab.edu>
Date: Thu, 27 Jul 2023 11:37:04 -0500
Subject: [PATCH] Add ssh username to ansible provisioner

---
 openstack-compute/nodeimage.pkr.hcl | 2 ++
 openstack-gpu/nodeimage.pkr.hcl     | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/openstack-compute/nodeimage.pkr.hcl b/openstack-compute/nodeimage.pkr.hcl
index 95a847f..c185672 100644
--- a/openstack-compute/nodeimage.pkr.hcl
+++ b/openstack-compute/nodeimage.pkr.hcl
@@ -23,6 +23,7 @@ build {
   sources = ["source.openstack.image"]
 
   provisioner "ansible" {
+    user = var.ssh_username
     groups = ["compute"]
     playbook_file = "./ansible/compute.yml"
     ansible_env_vars = [
@@ -35,6 +36,7 @@ build {
     ]
   }
   provisioner "ansible" {
+    user = var.ssh_username
     use_proxy =  false
     groups = ["compute"]
     playbook_file = "./CRI_XCBC/compute-packer.yaml"
diff --git a/openstack-gpu/nodeimage.pkr.hcl b/openstack-gpu/nodeimage.pkr.hcl
index a22751c..5011e7b 100644
--- a/openstack-gpu/nodeimage.pkr.hcl
+++ b/openstack-gpu/nodeimage.pkr.hcl
@@ -19,6 +19,7 @@ build {
   sources = ["source.openstack.image"]
 
   provisioner "ansible" {
+    user = var.ssh_username
     groups = ["compute"]
     playbook_file = "./ansible/compute.yml"
     ansible_env_vars = [
@@ -33,6 +34,7 @@ build {
   }
 
   provisioner "ansible" {
+    user = var.ssh_username
     groups = ["gpu"]
     playbook_file = "./ansible/gpu.yml"
     ansible_env_vars = [
@@ -46,6 +48,7 @@ build {
   }
 
   provisioner "ansible" {
+    user = var.ssh_username
     use_proxy =  false
     groups = ["compute"]
     playbook_file = "./CRI_XCBC/compute-packer.yaml"
-- 
GitLab