5 source = "github.com/hashicorp/openstack"
10 variable "cloud_auth_url" {
15 variable "cloud_tenant" {
20 variable "cloud_user" {
25 variable "cloud_pass" {
30 variable "source_ami_filter_name" {
35 variable "source_ami_filter_product_code" {
40 variable "source_ami_filter_owner" {
45 variable "ansible_roles_path" {
55 variable "base_image" {
60 variable "cloud_network" {
65 variable "cloud_region" {
70 variable "cloud_user_data" {
80 variable "docker_source_image" {
87 default = "v2-highcpu-1"
90 variable "ssh_proxy_host" {
100 variable "vm_image_disk_format" {
105 variable "vm_use_block_storage" {
110 variable "vm_volume_size" {
115 source "docker" "redis" {
116 changes = ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
118 image = "${var.docker_source_image}"
121 source "openstack" "redis" {
122 domain_name = "Default"
123 flavor = "v1-standard-1"
124 identity_endpoint = "${var.cloud_auth_url}"
125 image_name = "${var.distro} - redis - ${var.arch} - ${legacy_isotime("20180101-1003")}"
129 networks = ["${var.cloud_network}"]
130 password = "${var.cloud_pass}"
132 source_image_name = "${var.base_image}"
133 ssh_proxy_host = "${var.ssh_proxy_host}"
134 ssh_username = "${var.ssh_user}"
135 tenant_name = "${var.cloud_tenant}"
136 user_data_file = "${var.cloud_user_data}"
137 username = "${var.cloud_user}"
141 sources = ["source.docker.redis", "source.openstack.redis"]
143 provisioner "shell" {
144 execute_command = "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
145 scripts = ["common-packer/provision/install-python.sh"]
148 provisioner "shell-local" {
149 command = "./common-packer/ansible-galaxy.sh ${var.ansible_roles_path}"
152 provisioner "ansible" {
155 "ANSIBLE_PIPELINING=True",
156 "ANSIBLE_ROLES_PATH=${var.ansible_roles_path}",
157 "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
158 "ANSIBLE_STDOUT_CALLBACK=debug"
160 command = "./common-packer/ansible-playbook.sh"
162 "--scp-extra-args", "'-O'",
163 "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
165 playbook_file = "provision/redis.yaml"
166 skip_version_check = true