Skip to content

Commit 6b24f5d

Browse files
committed
use default packer inventory_hostname & clarify packer image/VM name
1 parent 7232467 commit 6b24f5d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packer/openstack.pkr.hcl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ source "openstack" "openhpc" {
7474
ssh_bastion_username = "${var.ssh_bastion_username}"
7575
ssh_bastion_private_key_file = "${var.ssh_bastion_private_key_file}"
7676
security_groups = "${var.security_groups}"
77-
image_name = "ohpc-${source.name}-${local.timestamp}" # want to use image name as instance name and dns name - can't include dots
77+
image_name = "ohpc-${source.name}-${local.timestamp}" # also provides a unique legal instance hostname (in case of parallel packer builds)
7878
image_visibility = "${var.image_visibility}"
7979
}
8080

@@ -94,15 +94,10 @@ build {
9494

9595
provisioner "ansible" {
9696
playbook_file = "${var.repo_root}/ansible/site.yml"
97-
host_alias = "ohpc-${source.name}-${local.timestamp}" # sets inventory_hostname, which we rely on matching hosts DNS name
9897
groups = concat(["builder"], split("-", "${source.name}"))
9998
keep_inventory_file = true # for debugging
10099
use_proxy = false # see https://www.packer.io/docs/provisioners/ansible#troubleshooting
101-
# TODO: use completely separate inventory, which just shares common? This will ensure
102-
# we don't accidently run anything via delegate_to.
103100
extra_arguments = ["--limit", "builder", "-i", "./ansible-inventory.sh", "-vv"]
104-
# TODO: Support vault password
105-
#ansible_env_vars = ["ANSIBLE_VAULT_PASSWORD_FILE=/home/stack/.kayobe-vault-pass"]
106101
}
107102

108103
post-processor "manifest" {

0 commit comments

Comments
 (0)