5 source = "github.com/hashicorp/openstack"
10 variable "ansible_roles_path" {
20 variable "base_image" {
25 variable "cloud_network" {
30 variable "cloud_region" {
35 variable "cloud_auth_url" {
40 variable "cloud_tenant" {
45 variable "cloud_user" {
50 variable "cloud_pass" {
55 variable "cloud_user_data" {
65 variable "docker_source_image" {
72 default = "v3-standard-2"
75 variable "ssh_proxy_host" {
80 variable "source_ami_filter_name" {
85 variable "source_ami_filter_product_code" {
90 variable "source_ami_filter_owner" {
99 variable "vm_image_disk_format" {
104 variable "vm_use_block_storage" {
109 variable "vm_volume_size" {
114 source "docker" "devstack" {
115 changes = ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
117 image = "${var.docker_source_image}"
120 source "openstack" "devstack" {
121 flavor = "${var.flavor}"
122 image_disk_format = "${var.vm_image_disk_format}"
123 image_name = "ZZCI - ${var.distro} - devstack - ${var.arch} - ${legacy_isotime("20060102-150405.000")}"
124 instance_name = "${var.distro}-devstack-${uuidv4()}"
128 networks = ["${var.cloud_network}"]
129 region = "${var.cloud_region}"
130 source_image_name = "${var.base_image}"
131 ssh_proxy_host = "${var.ssh_proxy_host}"
132 ssh_username = "${var.ssh_user}"
133 use_blockstorage_volume = "${var.vm_use_block_storage}"
134 user_data_file = "${var.cloud_user_data}"
135 volume_size = "${var.vm_volume_size}"
139 sources = ["source.docker.devstack", "source.openstack.devstack"]
141 provisioner "shell" {
142 execute_command = "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
143 scripts = ["common-packer/provision/install-python.sh"]
146 provisioner "shell-local" {
147 command = "./common-packer/ansible-galaxy.sh ${var.ansible_roles_path}"
150 provisioner "ansible" {
153 "ANSIBLE_PIPELINING=False",
154 "ANSIBLE_HOST_KEY_CHECKING=False",
155 "ANSIBLE_ROLES_PATH=${var.ansible_roles_path}",
156 "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
157 "ANSIBLE_STDOUT_CALLBACK=debug"
159 command = "./common-packer/ansible-playbook.sh"
161 "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa"
163 playbook_file = "provision/devstack-centos.yaml"
164 skip_version_check = true