diff --git a/openstack/nodeimage.pkr.hcl b/openstack/nodeimage.pkr.hcl index 5e4a24586bebf4c08bc15a0f2e78d581d1cf6c4b..c02d8531be8a8504a0c482380dcfc39d1c5fde44 100644 --- a/openstack/nodeimage.pkr.hcl +++ b/openstack/nodeimage.pkr.hcl @@ -6,12 +6,16 @@ source "openstack" "image" { image_name = local.local_image_name source_image_name = var.source_image flavor = var.flavor + instance_name = var.build_instance_name floating_ip_network = var.floating_ip_network networks = var.networks security_groups = var.security_groups ssh_username = var.ssh_username + ssh_keypair_name = var.ssh_keypair_name + ssh_private_key_file = var.ssh_private_key_file + } build { @@ -24,4 +28,18 @@ build { "--extra-vars", "root_ssh_key='${var.root_ssh_key}'" ] } + provisioner "ansible" { + use_proxy = false + ssh_authorized_key_file = "/home/ubuntu/.ssh/id_rsa.pub" + ansible_env_vars = ["ANSIBLE_HOST_KEY_CHECKING=False"] + playbook_file = "../CRI_XCBC/ood-packer.yaml" + roles_path = "./ansible/roles" + inventory_file = "../CRI_XCBC/hosts" + extra_arguments = [ + "--extra-vars", "root_ssh_key='${var.root_ssh_key}'", + "--private-key=${var.ssh_private_key_file}", + "--user=centos", + #"-vvvv" + ] + } }