Chore: Update common-packer to latest v0.14.0 60/106760/7
authorAnil Belur <abelur@linuxfoundation.org>
Thu, 29 Jun 2023 06:56:21 +0000 (16:56 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Mon, 3 Jul 2023 12:36:27 +0000 (22:36 +1000)
Create local templates in hcl2 format to work with packer
updates.

Add support for host key algorithms to work with local ssh
proxy without which packer builds results in "failed to
handshake" error. Workaround is to pass additional params
with "extra_arguments".

Change-Id: Ie716c3b844cf8a6adf5cd53e58ef92a3d22b82d2
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
23 files changed:
packer/common-packer
packer/provision/devstack-centos.yaml [moved from packer/provision/devstack.yaml with 85% similarity]
packer/provision/devstack-pre-pip-centos.yaml [moved from packer/provision/devstack-pre-pip.yaml with 95% similarity]
packer/provision/local-windows-builder.yaml [new symlink]
packer/templates/builder.json
packer/templates/builder.pkr.hcl [new symlink]
packer/templates/devstack-pre-pip-queens.json
packer/templates/devstack-pre-pip-queens.pkr.hcl [new file with mode: 0644]
packer/templates/devstack-pre-pip-rocky.json
packer/templates/devstack-pre-pip-rocky.pkr.hcl [new file with mode: 0644]
packer/templates/devstack-pre-pip-stein.json
packer/templates/devstack-pre-pip-stein.pkr.hcl [new file with mode: 0644]
packer/templates/devstack-pre-pip-yoga.json [new file with mode: 0644]
packer/templates/devstack-pre-pip-yoga.pkr.hcl [new file with mode: 0644]
packer/templates/devstack.json
packer/templates/devstack.pkr.hcl [new file with mode: 0644]
packer/templates/docker.pkr.hcl [new symlink]
packer/templates/helm.json
packer/templates/helm.pkr.hcl [new file with mode: 0644]
packer/templates/mininet-ovs-2.8.json
packer/templates/mininet-ovs-2.8.pkr.hcl [new file with mode: 0644]
packer/templates/robot.json
packer/templates/robot.pkr.hcl [new file with mode: 0644]

index 15aba27a45f98edb33890daa3712c6a4371b2947..626eb9c0fbfd8cbc8115aacfa21ef07f55695d54 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 15aba27a45f98edb33890daa3712c6a4371b2947
+Subproject commit 626eb9c0fbfd8cbc8115aacfa21ef07f55695d54
similarity index 85%
rename from packer/provision/devstack.yaml
rename to packer/provision/devstack-centos.yaml
index ecad96747d3a6075c7ffaefd6a6f6bce846577c3..0a893a0754e0c2d7de69b7cac80bd4b53858b5cf 100644 (file)
           yum:
             name:
               - perl-XML-XPath
-              - python-pip
               - crudini
             state: present
           become: true
         - name: Installing non-baseline requirements
           yum:
             name:
-              - deltarpm
-              - python
-              - python-crypto
-              - python-devel
-              - python-lxml
-              - python-setuptools
               - libxml2-devel
               - libxslt-devel
               - libffi-devel
similarity index 95%
rename from packer/provision/devstack-pre-pip.yaml
rename to packer/provision/devstack-pre-pip-centos.yaml
index 65566d3538e5a978281928e7bf6d30ab9c780f4f..fefe5647d9965252a13bc5810e3c4759f7b81d2a 100644 (file)
           yum:
             name:
               - perl-XML-XPath
-              - python-pip
               - crudini
             state: present
           become: true
         - name: Install non-baseline requirements
           yum:
             name:
-              - deltarpm
-              - python
-              - python-crypto
-              - python-devel
-              - python-lxml
-              - python-setuptools
               - libxml2-devel
               - libxslt-devel
               - libffi-devel
diff --git a/packer/provision/local-windows-builder.yaml b/packer/provision/local-windows-builder.yaml
new file mode 120000 (symlink)
index 0000000..5c3fc5c
--- /dev/null
@@ -0,0 +1 @@
+../common-packer/provision/local-windows-builder.yaml
\ No newline at end of file
index 51ebe88d98784076eea94c86c0ace2d56399dde4..8c7cb68ba5f1adae1a1d80c684accca42698b543 100644 (file)
         "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
         "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
         "ANSIBLE_STDOUT_CALLBACK=debug"
+      ],
+      "extra_arguments": [
+        "--scp-extra-args", "'-O'",
+        "--ssh-extra-args",
+        "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
       ]
     }
   ]
diff --git a/packer/templates/builder.pkr.hcl b/packer/templates/builder.pkr.hcl
new file mode 120000 (symlink)
index 0000000..8ea2d87
--- /dev/null
@@ -0,0 +1 @@
+../common-packer/templates/builder.pkr.hcl
\ No newline at end of file
index 170bdc0c7e41bc902a4d9c6910d348c56ffc6617..b774c67b919904bcdf457e90a24236f953c7ce3b 100644 (file)
@@ -54,7 +54,7 @@
     },
     {
       "type": "ansible",
-      "playbook_file": "provision/devstack-pre-pip.yaml",
+      "playbook_file": "provision/devstack-pre-pip-centos.yaml",
       "command": "./common-packer/ansible-playbook.sh",
       "skip_version_check": true,
       "ansible_env_vars": [
       ],
       "extra_arguments": [
         "--extra-vars",
-        "os_branch=stable/queens rdo_branch=queens"
+        "os_branch=stable/queens rdo_branch=queens",
+        "--scp-extra-args", "'-O'",
+        "--ssh-extra-args",
+        "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
       ]
     }
   ]
diff --git a/packer/templates/devstack-pre-pip-queens.pkr.hcl b/packer/templates/devstack-pre-pip-queens.pkr.hcl
new file mode 100644 (file)
index 0000000..a12c12e
--- /dev/null
@@ -0,0 +1,168 @@
+packer {
+  required_plugins {
+    openstack = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/openstack"
+    }
+  }
+}
+
+variable "ansible_roles_path" {
+  type    = string
+  default = ".galaxy"
+}
+
+variable "arch" {
+  type    = string
+  default = "x86_64"
+}
+
+variable "base_image" {
+  type = string
+  default = null
+}
+
+variable "cloud_network" {
+  type = string
+  default = null
+}
+
+variable "cloud_region" {
+  type    = string
+  default = "ca-ymq-1"
+}
+
+variable "cloud_auth_url" {
+  type    = string
+  default = null
+}
+
+variable "cloud_tenant" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user" {
+  type    = string
+  default = null
+}
+
+variable "cloud_pass" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user_data" {
+  type = string
+  default = null
+}
+
+variable "distro" {
+  type = string
+  default = null
+}
+
+variable "docker_source_image" {
+  type = string
+  default = null
+}
+
+variable "flavor" {
+  type    = string
+  default = "v3-standard-2"
+}
+
+variable "ssh_proxy_host" {
+  type    = string
+  default = ""
+}
+
+variable "source_ami_filter_name" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_product_code" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_owner" {
+  type    = string
+  default = null
+}
+
+variable "ssh_user" {
+  type = string
+}
+
+variable "vm_image_disk_format" {
+  type    = string
+  default = ""
+}
+
+variable "vm_use_block_storage" {
+  type    = string
+  default = "true"
+}
+
+variable "vm_volume_size" {
+  type    = string
+  default = "20"
+}
+
+source "docker" "devstack-pre-pip-queens" {
+  changes = ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
+  commit  = true
+  image   = "${var.docker_source_image}"
+}
+
+source "openstack" "devstack-pre-pip-queens" {
+  flavor            = "${var.flavor}"
+  image_disk_format = "${var.vm_image_disk_format}"
+  image_name        = "ZZCI - ${var.distro} - devstack-queens - ${var.arch} - ${legacy_isotime("20060102-150405.000")}"
+  instance_name     = "${var.distro}-devstack-queens-${uuidv4()}"
+  metadata = {
+    ci_managed = "yes"
+  }
+  networks                = ["${var.cloud_network}"]
+  region                  = "${var.cloud_region}"
+  source_image_name       = "${var.base_image}"
+  ssh_proxy_host          = "${var.ssh_proxy_host}"
+  ssh_username            = "${var.ssh_user}"
+  use_blockstorage_volume = "${var.vm_use_block_storage}"
+  user_data_file          = "${var.cloud_user_data}"
+  volume_size             = "${var.vm_volume_size}"
+}
+
+build {
+  sources = ["source.docker.devstack-pre-pip-queens", "source.openstack.devstack-pre-pip-queens"]
+
+  provisioner "shell" {
+    execute_command = "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    scripts         = ["common-packer/provision/install-python.sh"]
+  }
+
+  provisioner "shell-local" {
+    command = "./common-packer/ansible-galaxy.sh ${var.ansible_roles_path}"
+  }
+
+  provisioner "ansible" {
+    ansible_env_vars   = [
+      "ANSIBLE_DEBUG=False",
+      "ANSIBLE_NOCOWS=1",
+      "ANSIBLE_PIPELINING=True",
+      "ANSIBLE_ROLES_PATH=${var.ansible_roles_path}",
+      "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
+      "ANSIBLE_STDOUT_CALLBACK=debug"
+    ]
+    command            = "./common-packer/ansible-playbook.sh"
+    extra_arguments    = [
+      "--extra-vars", "os_branch=stable/queens rdo_branch=queens",
+      "--scp-extra-args", "'-O'",
+      "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
+    ]
+    playbook_file      = "provision/devstack-pre-pip-centos.yaml"
+    skip_version_check = true
+  }
+}
index 175f82e43e0c1fb09b3c6f8d79aaac74d54d93bb..a6e68084be108e496cfbadf959318f5177081a1f 100644 (file)
@@ -55,7 +55,7 @@
     },
     {
       "type": "ansible",
-      "playbook_file": "provision/devstack-pre-pip.yaml",
+      "playbook_file": "provision/devstack-pre-pip-centos.yaml",
       "command": "./common-packer/ansible-playbook.sh",
       "skip_version_check": true,
       "ansible_env_vars": [
       ],
       "extra_arguments": [
         "--extra-vars",
-        "os_branch=stable/rocky rdo_branch=rocky"
+        "os_branch=stable/queens rdo_branch=queens",
+        "--scp-extra-args", "'-O'",
+        "--ssh-extra-args",
+        "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
       ]
     }
   ]
diff --git a/packer/templates/devstack-pre-pip-rocky.pkr.hcl b/packer/templates/devstack-pre-pip-rocky.pkr.hcl
new file mode 100644 (file)
index 0000000..e65dc54
--- /dev/null
@@ -0,0 +1,168 @@
+packer {
+  required_plugins {
+    openstack = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/openstack"
+    }
+  }
+}
+
+variable "ansible_roles_path" {
+  type    = string
+  default = ".galaxy"
+}
+
+variable "arch" {
+  type    = string
+  default = "x86_64"
+}
+
+variable "base_image" {
+  type = string
+  default = null
+}
+
+variable "cloud_network" {
+  type = string
+  default = null
+}
+
+variable "cloud_region" {
+  type    = string
+  default = "ca-ymq-1"
+}
+
+variable "cloud_auth_url" {
+  type    = string
+  default = null
+}
+
+variable "cloud_tenant" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user" {
+  type    = string
+  default = null
+}
+
+variable "cloud_pass" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user_data" {
+  type = string
+  default = null
+}
+
+variable "distro" {
+  type = string
+  default = null
+}
+
+variable "docker_source_image" {
+  type = string
+  default = null
+}
+
+variable "flavor" {
+  type    = string
+  default = "v3-standard-2"
+}
+
+variable "ssh_proxy_host" {
+  type    = string
+  default = ""
+}
+
+variable "source_ami_filter_name" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_product_code" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_owner" {
+  type    = string
+  default = null
+}
+
+variable "ssh_user" {
+  type = string
+}
+
+variable "vm_image_disk_format" {
+  type    = string
+  default = ""
+}
+
+variable "vm_use_block_storage" {
+  type    = string
+  default = "true"
+}
+
+variable "vm_volume_size" {
+  type    = string
+  default = "20"
+}
+
+source "docker" "devstack-pre-pip-rocky" {
+  changes = ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
+  commit  = true
+  image   = "${var.docker_source_image}"
+}
+
+source "openstack" "devstack-pre-pip-rocky" {
+  flavor            = "${var.flavor}"
+  image_disk_format = "${var.vm_image_disk_format}"
+  image_name        = "ZZCI - ${var.distro} - devstack-rocky - ${var.arch} - ${legacy_isotime("20060102-150405.000")}"
+  instance_name     = "${var.distro}-devstack-rocky-${uuidv4()}"
+  metadata = {
+    ci_managed = "yes"
+  }
+  networks                = ["${var.cloud_network}"]
+  region                  = "${var.cloud_region}"
+  source_image_name       = "${var.base_image}"
+  ssh_proxy_host          = "${var.ssh_proxy_host}"
+  ssh_username            = "${var.ssh_user}"
+  use_blockstorage_volume = "${var.vm_use_block_storage}"
+  user_data_file          = "${var.cloud_user_data}"
+  volume_size             = "${var.vm_volume_size}"
+}
+
+build {
+  sources = ["source.docker.devstack-pre-pip-rocky", "source.openstack.devstack-pre-pip-rocky"]
+
+  provisioner "shell" {
+    execute_command = "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    scripts         = ["common-packer/provision/install-python.sh"]
+  }
+
+  provisioner "shell-local" {
+    command = "./common-packer/ansible-galaxy.sh ${var.ansible_roles_path}"
+  }
+
+  provisioner "ansible" {
+    ansible_env_vars   = [
+      "ANSIBLE_DEBUG=False",
+      "ANSIBLE_NOCOWS=1",
+      "ANSIBLE_PIPELINING=True",
+      "ANSIBLE_ROLES_PATH=${var.ansible_roles_path}",
+      "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
+      "ANSIBLE_STDOUT_CALLBACK=debug"
+    ]
+    command            = "./common-packer/ansible-playbook.sh"
+    extra_arguments    = [
+      "--extra-vars", "os_branch=stable/queens rdo_branch=queens",
+      "--scp-extra-args", "'-O'",
+      "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
+    ]
+    playbook_file      = "provision/devstack-pre-pip-centos.yaml"
+    skip_version_check = true
+  }
+}
index 9abb28f4a90b702000f4203d65bf9d41fb436d2b..18f9f24f2fcbb41aedf0542b6499dcb51d63b000 100644 (file)
@@ -55,7 +55,7 @@
     },
     {
       "type": "ansible",
-      "playbook_file": "provision/devstack-pre-pip.yaml",
+      "playbook_file": "provision/devstack-pre-pip-centos.yaml",
       "command": "./common-packer/ansible-playbook.sh",
       "skip_version_check": true,
       "ansible_env_vars": [
       ],
       "extra_arguments": [
         "--extra-vars",
-        "os_branch=stable/stein rdo_branch=stein"
+        "os_branch=stable/queens rdo_branch=queens",
+        "--scp-extra-args", "'-O'",
+        "--ssh-extra-args",
+        "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
       ]
     }
   ]
diff --git a/packer/templates/devstack-pre-pip-stein.pkr.hcl b/packer/templates/devstack-pre-pip-stein.pkr.hcl
new file mode 100644 (file)
index 0000000..796be7a
--- /dev/null
@@ -0,0 +1,157 @@
+packer {
+  required_plugins {
+    openstack = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/openstack"
+    }
+  }
+}
+
+variable "ansible_roles_path" {
+  type    = string
+  default = ".galaxy"
+}
+
+variable "arch" {
+  type    = string
+  default = "x86_64"
+}
+
+variable "base_image" {
+  type = string
+  default = null
+}
+
+variable "cloud_network" {
+  type = string
+  default = null
+}
+
+variable "cloud_region" {
+  type    = string
+  default = "ca-ymq-1"
+}
+
+variable "cloud_auth_url" {
+  type    = string
+  default = null
+}
+
+variable "cloud_tenant" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user" {
+  type    = string
+  default = null
+}
+
+variable "cloud_pass" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user_data" {
+  type = string
+  default = null
+}
+
+variable "distro" {
+  type = string
+  default = null
+}
+
+variable "docker_source_image" {
+  type = string
+  default = null
+}
+
+variable "flavor" {
+  type    = string
+  default = "v3-standard-2"
+}
+
+variable "ssh_proxy_host" {
+  type    = string
+  default = ""
+}
+
+variable "source_ami_filter_name" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_product_code" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_owner" {
+  type    = string
+  default = null
+}
+
+variable "ssh_user" {
+  type = string
+}
+
+variable "vm_image_disk_format" {
+  type    = string
+  default = ""
+}
+
+variable "vm_use_block_storage" {
+  type    = string
+  default = "true"
+}
+
+variable "vm_volume_size" {
+  type    = string
+  default = "20"
+}
+
+source "docker" "devstack-pre-pip-stein" {
+  changes = ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
+  commit  = true
+  image   = "${var.docker_source_image}"
+}
+
+source "openstack" "devstack-pre-pip-stein" {
+  flavor            = "${var.flavor}"
+  image_disk_format = "${var.vm_image_disk_format}"
+  image_name        = "ZZCI - ${var.distro} - devstack-stein - ${var.arch} - ${legacy_isotime("20060102-150405.000")}"
+  instance_name     = "${var.distro}-devstack-stein-${uuidv4()}"
+  metadata = {
+    ci_managed = "yes"
+  }
+  networks                = ["${var.cloud_network}"]
+  region                  = "${var.cloud_region}"
+  source_image_name       = "${var.base_image}"
+  ssh_proxy_host          = "${var.ssh_proxy_host}"
+  ssh_username            = "${var.ssh_user}"
+  use_blockstorage_volume = "${var.vm_use_block_storage}"
+  user_data_file          = "${var.cloud_user_data}"
+  volume_size             = "${var.vm_volume_size}"
+}
+
+build {
+  sources = ["source.docker.devstack-pre-pip-stein", "source.openstack.devstack-pre-pip-stein"]
+
+  provisioner "shell" {
+    execute_command = "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    scripts         = ["common-packer/provision/install-python.sh"]
+  }
+
+  provisioner "shell-local" {
+    command = "./common-packer/ansible-galaxy.sh ${var.ansible_roles_path}"
+  }
+
+  provisioner "ansible" {
+    ansible_env_vars   = ["ANSIBLE_DEBUG=False", "ANSIBLE_NOCOWS=1", "ANSIBLE_PIPELINING=True", "ANSIBLE_ROLES_PATH=${var.ansible_roles_path}", "ANSIBLE_CALLBACK_WHITELIST=profile_tasks", "ANSIBLE_STDOUT_CALLBACK=debug"]
+    command            = "./common-packer/ansible-playbook.sh"
+    extra_arguments    = ["--extra-vars", "os_branch=stable/queens rdo_branch=queens", "--scp-extra-args", "'-O'", "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"]
+    playbook_file      = "provision/devstack-pre-pip-centos.yaml"
+    skip_version_check = true
+  }
+}
diff --git a/packer/templates/devstack-pre-pip-yoga.json b/packer/templates/devstack-pre-pip-yoga.json
new file mode 100644 (file)
index 0000000..8c406cd
--- /dev/null
@@ -0,0 +1,78 @@
+{
+  "variables": {
+    "ansible_roles_path": ".galaxy",
+    "arch": "x86_64",
+    "base_image": null,
+    "cloud_network": null,
+    "cloud_user_data": null,
+    "cloud_region": "ca-ymq-1",
+    "vm_use_block_storage": "true",
+    "vm_volume_size": "20",
+    "vm_image_disk_format": "",
+    "distro": null,
+    "docker_source_image": null,
+    "flavor": "v3-standard-2",
+    "ssh_user": null,
+    "ssh_proxy_host": ""
+  },
+  "builders": [
+    {
+      "name": "openstack",
+      "image_name": "ZZCI - {{user `distro`}} - devstack-yoga - {{user `arch`}} - {{isotime \"20060102-150405.000\"}}",
+      "instance_name": "{{user `distro`}}-devstack-yoga-{{uuid}}",
+      "source_image_name": "{{user `base_image`}}",
+      "type": "openstack",
+      "region": "{{user `cloud_region`}}",
+      "networks": ["{{user `cloud_network`}}"],
+      "user_data_file": "{{user `cloud_user_data`}}",
+      "ssh_username": "{{user `ssh_user`}}",
+      "ssh_proxy_host": "{{user `ssh_proxy_host`}}",
+      "flavor": "{{user `flavor`}}",
+      "metadata": {
+        "ci_managed": "yes"
+      },
+      "use_blockstorage_volume": "{{user `vm_use_block_storage`}}",
+      "volume_size": "{{user `vm_volume_size`}}",
+      "image_disk_format": "{{user `vm_image_disk_format`}}"
+    },
+    {
+      "name": "docker",
+      "type": "docker",
+      "image": "{{ user `docker_source_image` }}",
+      "commit": true,
+      "changes": ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
+    }
+  ],
+  "provisioners": [
+    {
+      "type": "shell",
+      "scripts": ["common-packer/provision/install-python.sh"],
+      "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    },
+    {
+      "type": "shell-local",
+      "command": "./common-packer/ansible-galaxy.sh {{user `ansible_roles_path`}}"
+    },
+    {
+      "type": "ansible",
+      "playbook_file": "provision/devstack-pre-pip-centos.yaml",
+      "command": "./common-packer/ansible-playbook.sh",
+      "skip_version_check": true,
+      "ansible_env_vars": [
+        "ANSIBLE_DEBUG=False",
+        "ANSIBLE_NOCOWS=1",
+        "ANSIBLE_PIPELINING=True",
+        "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
+        "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
+        "ANSIBLE_STDOUT_CALLBACK=debug"
+      ],
+      "extra_arguments": [
+        "--extra-vars",
+        "os_branch=stable/yoga rdo_branch=yoga",
+        "--scp-extra-args", "'-O'",
+        "--ssh-extra-args",
+        "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
+      ]
+    }
+  ]
+}
diff --git a/packer/templates/devstack-pre-pip-yoga.pkr.hcl b/packer/templates/devstack-pre-pip-yoga.pkr.hcl
new file mode 100644 (file)
index 0000000..030fb3f
--- /dev/null
@@ -0,0 +1,157 @@
+packer {
+  required_plugins {
+    openstack = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/openstack"
+    }
+  }
+}
+
+variable "ansible_roles_path" {
+  type    = string
+  default = ".galaxy"
+}
+
+variable "arch" {
+  type    = string
+  default = "x86_64"
+}
+
+variable "base_image" {
+  type = string
+  default = null
+}
+
+variable "cloud_network" {
+  type = string
+  default = null
+}
+
+variable "cloud_region" {
+  type    = string
+  default = "ca-ymq-1"
+}
+
+variable "cloud_auth_url" {
+  type    = string
+  default = null
+}
+
+variable "cloud_tenant" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user" {
+  type    = string
+  default = null
+}
+
+variable "cloud_pass" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user_data" {
+  type = string
+  default = null
+}
+
+variable "distro" {
+  type = string
+  default = null
+}
+
+variable "docker_source_image" {
+  type = string
+  default = null
+}
+
+variable "flavor" {
+  type    = string
+  default = "v3-standard-2"
+}
+
+variable "ssh_proxy_host" {
+  type    = string
+  default = ""
+}
+
+variable "source_ami_filter_name" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_product_code" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_owner" {
+  type    = string
+  default = null
+}
+
+variable "ssh_user" {
+  type = string
+}
+
+variable "vm_image_disk_format" {
+  type    = string
+  default = ""
+}
+
+variable "vm_use_block_storage" {
+  type    = string
+  default = "true"
+}
+
+variable "vm_volume_size" {
+  type    = string
+  default = "20"
+}
+
+source "docker" "devstack-pre-pip-yoga" {
+  changes = ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
+  commit  = true
+  image   = "${var.docker_source_image}"
+}
+
+source "openstack" "devstack-pre-pip-yoga" {
+  flavor            = "${var.flavor}"
+  image_disk_format = "${var.vm_image_disk_format}"
+  image_name        = "ZZCI - ${var.distro} - devstack-yoga - ${var.arch} - ${legacy_isotime("20060102-150405.000")}"
+  instance_name     = "${var.distro}-devstack-yoga-${uuidv4()}"
+  metadata = {
+    ci_managed = "yes"
+  }
+  networks                = ["${var.cloud_network}"]
+  region                  = "${var.cloud_region}"
+  source_image_name       = "${var.base_image}"
+  ssh_proxy_host          = "${var.ssh_proxy_host}"
+  ssh_username            = "${var.ssh_user}"
+  use_blockstorage_volume = "${var.vm_use_block_storage}"
+  user_data_file          = "${var.cloud_user_data}"
+  volume_size             = "${var.vm_volume_size}"
+}
+
+build {
+  sources = ["source.docker.devstack-pre-pip-yoga", "source.openstack.devstack-pre-pip-yoga"]
+
+  provisioner "shell" {
+    execute_command = "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    scripts         = ["common-packer/provision/install-python.sh"]
+  }
+
+  provisioner "shell-local" {
+    command = "./common-packer/ansible-galaxy.sh ${var.ansible_roles_path}"
+  }
+
+  provisioner "ansible" {
+    ansible_env_vars   = ["ANSIBLE_DEBUG=False", "ANSIBLE_NOCOWS=1", "ANSIBLE_PIPELINING=True", "ANSIBLE_ROLES_PATH=${var.ansible_roles_path}", "ANSIBLE_CALLBACK_WHITELIST=profile_tasks", "ANSIBLE_STDOUT_CALLBACK=debug"]
+    command            = "./common-packer/ansible-playbook.sh"
+    extra_arguments    = ["--extra-vars", "os_branch=stable/yoga rdo_branch=yoga", "--scp-extra-args", "'-O'", "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"]
+    playbook_file      = "provision/devstack-pre-pip-centos.yaml"
+    skip_version_check = true
+  }
+}
index 98a1f13e072bf618489d61af1a87d050fdf1de1e..ba82499f807f8dba07bf4b99a9682a682b0d930e 100644 (file)
@@ -55,7 +55,7 @@
     },
     {
       "type": "ansible",
-      "playbook_file": "provision/devstack.yaml",
+      "playbook_file": "provision/devstack-centos.yaml",
       "command": "./common-packer/ansible-playbook.sh",
       "skip_version_check": true,
       "ansible_env_vars": [
         "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
         "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
         "ANSIBLE_STDOUT_CALLBACK=debug"
+      ],
+      "extra_arguments": [
+        "--scp-extra-args", "'-O'",
+        "--ssh-extra-args",
+        "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
       ]
     }
   ]
diff --git a/packer/templates/devstack.pkr.hcl b/packer/templates/devstack.pkr.hcl
new file mode 100644 (file)
index 0000000..9a815e5
--- /dev/null
@@ -0,0 +1,157 @@
+packer {
+  required_plugins {
+    openstack = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/openstack"
+    }
+  }
+}
+
+variable "ansible_roles_path" {
+  type    = string
+  default = ".galaxy"
+}
+
+variable "arch" {
+  type    = string
+  default = "x86_64"
+}
+
+variable "base_image" {
+  type = string
+  default = null
+}
+
+variable "cloud_network" {
+  type = string
+  default = null
+}
+
+variable "cloud_region" {
+  type    = string
+  default = "ca-ymq-1"
+}
+
+variable "cloud_auth_url" {
+  type    = string
+  default = null
+}
+
+variable "cloud_tenant" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user" {
+  type    = string
+  default = null
+}
+
+variable "cloud_pass" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user_data" {
+  type = string
+  default = null
+}
+
+variable "distro" {
+  type = string
+  default = null
+}
+
+variable "docker_source_image" {
+  type = string
+  default = null
+}
+
+variable "flavor" {
+  type    = string
+  default = "v3-standard-2"
+}
+
+variable "ssh_proxy_host" {
+  type    = string
+  default = ""
+}
+
+variable "source_ami_filter_name" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_product_code" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_owner" {
+  type    = string
+  default = null
+}
+
+variable "ssh_user" {
+  type = string
+}
+
+variable "vm_image_disk_format" {
+  type    = string
+  default = ""
+}
+
+variable "vm_use_block_storage" {
+  type    = string
+  default = "true"
+}
+
+variable "vm_volume_size" {
+  type    = string
+  default = "20"
+}
+
+source "docker" "devstack" {
+  changes = ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
+  commit  = true
+  image   = "${var.docker_source_image}"
+}
+
+source "openstack" "devstack" {
+  flavor            = "${var.flavor}"
+  image_disk_format = "${var.vm_image_disk_format}"
+  image_name        = "ZZCI - ${var.distro} - devstack - ${var.arch} - ${legacy_isotime("20060102-150405.000")}"
+  instance_name     = "${var.distro}-devstack-${uuidv4()}"
+  metadata = {
+    ci_managed = "yes"
+  }
+  networks                = ["${var.cloud_network}"]
+  region                  = "${var.cloud_region}"
+  source_image_name       = "${var.base_image}"
+  ssh_proxy_host          = "${var.ssh_proxy_host}"
+  ssh_username            = "${var.ssh_user}"
+  use_blockstorage_volume = "${var.vm_use_block_storage}"
+  user_data_file          = "${var.cloud_user_data}"
+  volume_size             = "${var.vm_volume_size}"
+}
+
+build {
+  sources = ["source.docker.devstack", "source.openstack.devstack"]
+
+  provisioner "shell" {
+    execute_command = "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    scripts         = ["common-packer/provision/install-python.sh"]
+  }
+
+  provisioner "shell-local" {
+    command = "./common-packer/ansible-galaxy.sh ${var.ansible_roles_path}"
+  }
+
+  provisioner "ansible" {
+    ansible_env_vars   = ["ANSIBLE_NOCOWS=1", "ANSIBLE_PIPELINING=True", "ANSIBLE_ROLES_PATH=${var.ansible_roles_path}", "ANSIBLE_CALLBACK_WHITELIST=profile_tasks", "ANSIBLE_STDOUT_CALLBACK=debug"]
+    command            = "./common-packer/ansible-playbook.sh"
+    extra_arguments    = ["--scp-extra-args", "'-O'", "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"]
+    playbook_file      = "provision/devstack-centos.yaml"
+    skip_version_check = true
+  }
+}
diff --git a/packer/templates/docker.pkr.hcl b/packer/templates/docker.pkr.hcl
new file mode 120000 (symlink)
index 0000000..08567df
--- /dev/null
@@ -0,0 +1 @@
+../common-packer/templates/docker.pkr.hcl
\ No newline at end of file
index f45c042d728f8e029ea1ffeff83c56ecdff31e18..53543d350be6ccd43f1f186f864d7fa1d4e5898a 100644 (file)
         "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
         "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
         "ANSIBLE_STDOUT_CALLBACK=debug"
+      ],
+      "extra_arguments": [
+        "--scp-extra-args", "'-O'",
+        "--ssh-extra-args",
+        "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
       ]
     }
   ]
diff --git a/packer/templates/helm.pkr.hcl b/packer/templates/helm.pkr.hcl
new file mode 100644 (file)
index 0000000..d5bf312
--- /dev/null
@@ -0,0 +1,165 @@
+packer {
+  required_plugins {
+    openstack = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/openstack"
+    }
+  }
+}
+
+variable "ansible_roles_path" {
+  type    = string
+  default = ".galaxy"
+}
+
+variable "arch" {
+  type    = string
+  default = "x86_64"
+}
+
+variable "base_image" {
+  type = string
+  default = null
+}
+
+variable "cloud_network" {
+  type = string
+  default = null
+}
+
+variable "cloud_region" {
+  type    = string
+  default = "ca-ymq-1"
+}
+
+variable "cloud_auth_url" {
+  type    = string
+  default = null
+}
+
+variable "cloud_tenant" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user" {
+  type    = string
+  default = null
+}
+
+variable "cloud_pass" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user_data" {
+  type = string
+  default = null
+}
+
+variable "distro" {
+  type = string
+  default = null
+}
+
+variable "docker_source_image" {
+  type = string
+  default = null
+}
+
+variable "flavor" {
+  type    = string
+  default = "v3-standard-2"
+}
+
+variable "ssh_proxy_host" {
+  type    = string
+  default = ""
+}
+
+variable "source_ami_filter_name" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_product_code" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_owner" {
+  type    = string
+  default = null
+}
+
+variable "ssh_user" {
+  type = string
+}
+
+variable "vm_image_disk_format" {
+  type    = string
+  default = ""
+}
+
+variable "vm_use_block_storage" {
+  type    = string
+  default = "true"
+}
+
+variable "vm_volume_size" {
+  type    = string
+  default = "20"
+}
+
+source "docker" "helm" {
+  changes = ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
+  commit  = true
+  image   = "${var.docker_source_image}"
+}
+
+source "openstack" "helm" {
+  domain_name       = "Default"
+  flavor            = "v1-standard-1"
+  identity_endpoint = "${var.cloud_auth_url}"
+  image_disk_format = "${var.vm_image_disk_format}"
+  image_name        = "ZZCI - ${var.distro} - helm - ${var.arch} - ${legacy_isotime("20060102-150405.000")}"
+  instance_name     = "${var.distro}-builder-${uuidv4()}"
+  metadata = {
+    ci_managed = "yes"
+  }
+  networks                = ["${var.cloud_network}"]
+  password                = "${var.cloud_pass}"
+  region                  = "ca-ymq-1"
+  source_image_name       = "${var.base_image}"
+  ssh_proxy_host          = "${var.ssh_proxy_host}"
+  ssh_username            = "${var.ssh_user}"
+  tenant_name             = "${var.cloud_tenant}"
+  use_blockstorage_volume = "${var.vm_use_block_storage}"
+  user_data_file          = "${var.cloud_user_data}"
+  username                = "${var.cloud_user}"
+  volume_size             = "${var.vm_volume_size}"
+}
+
+# a build block invokes sources and runs provisioning steps on them. The
+# documentation for build blocks can be found here:
+# https://www.packer.io/docs/templates/hcl_templates/blocks/build
+build {
+  sources = ["source.docker.helm", "source.openstack.helm"]
+
+  provisioner "shell" {
+    execute_command = "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    scripts         = ["common-packer/provision/install-python.sh"]
+  }
+
+  provisioner "shell-local" {
+    command = "./common-packer/ansible-galaxy.sh ${var.ansible_roles_path}"
+  }
+
+  provisioner "ansible" {
+    ansible_env_vars   = ["ANSIBLE_NOCOWS=1", "ANSIBLE_PIPELINING=True", "ANSIBLE_ROLES_PATH=${var.ansible_roles_path}", "ANSIBLE_CALLBACK_WHITELIST=profile_tasks", "ANSIBLE_STDOUT_CALLBACK=debug"]
+    command            = "./common-packer/ansible-playbook.sh"
+    extra_arguments    = ["--scp-extra-args", "'-O'", "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"]
+    playbook_file      = "provision/helm.yaml"
+    skip_version_check = true
+  }
+}
index 9c08471604f73d77671ba167bc07f71ceab00c5d..29c5aba1e2cad5ba43a3ce8b83707c2958e407a2 100644 (file)
         "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
         "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
         "ANSIBLE_STDOUT_CALLBACK=debug"
+      ],
+      "extra_arguments": [
+        "--scp-extra-args", "'-O'",
+        "--ssh-extra-args",
+        "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
       ]
     }
   ]
diff --git a/packer/templates/mininet-ovs-2.8.pkr.hcl b/packer/templates/mininet-ovs-2.8.pkr.hcl
new file mode 100644 (file)
index 0000000..c41478f
--- /dev/null
@@ -0,0 +1,156 @@
+packer {
+  required_plugins {
+    openstack = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/openstack"
+    }
+  }
+}
+variable "ansible_roles_path" {
+  type    = string
+  default = ".galaxy"
+}
+
+variable "arch" {
+  type    = string
+  default = "x86_64"
+}
+
+variable "base_image" {
+  type = string
+  default = null
+}
+
+variable "cloud_network" {
+  type = string
+  default = null
+}
+
+variable "cloud_region" {
+  type    = string
+  default = "ca-ymq-1"
+}
+
+variable "cloud_auth_url" {
+  type    = string
+  default = null
+}
+
+variable "cloud_tenant" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user" {
+  type    = string
+  default = null
+}
+
+variable "cloud_pass" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user_data" {
+  type = string
+  default = null
+}
+
+variable "distro" {
+  type = string
+  default = null
+}
+
+variable "docker_source_image" {
+  type = string
+  default = null
+}
+
+variable "flavor" {
+  type    = string
+  default = "v3-standard-2"
+}
+
+variable "ssh_proxy_host" {
+  type    = string
+  default = ""
+}
+
+variable "source_ami_filter_name" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_product_code" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_owner" {
+  type    = string
+  default = null
+}
+
+variable "ssh_user" {
+  type = string
+}
+
+variable "vm_image_disk_format" {
+  type    = string
+  default = ""
+}
+
+variable "vm_use_block_storage" {
+  type    = string
+  default = "true"
+}
+
+variable "vm_volume_size" {
+  type    = string
+  default = "20"
+}
+
+source "docker" "mininet-ovs-28" {
+  changes = ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
+  commit  = true
+  image   = "${var.docker_source_image}"
+}
+
+source "openstack" "mininet-ovs-28" {
+  flavor            = "${var.flavor}"
+  image_disk_format = "${var.vm_image_disk_format}"
+  image_name        = "ZZCI - ${var.distro} - mininet-ovs-28 - ${var.arch} - ${legacy_isotime("20060102-150405.000")}"
+  instance_name     = "${var.distro}-mininet-ovs-28-${uuidv4()}"
+  metadata = {
+    ci_managed = "yes"
+  }
+  networks                = ["${var.cloud_network}"]
+  region                  = "${var.cloud_region}"
+  source_image_name       = "${var.base_image}"
+  ssh_proxy_host          = "${var.ssh_proxy_host}"
+  ssh_username            = "${var.ssh_user}"
+  use_blockstorage_volume = "${var.vm_use_block_storage}"
+  user_data_file          = "${var.cloud_user_data}"
+  volume_size             = "${var.vm_volume_size}"
+}
+
+build {
+  sources = ["source.docker.mininet-ovs-28", "source.openstack.mininet-ovs-28"]
+
+  provisioner "shell" {
+    execute_command = "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    scripts         = ["common-packer/provision/install-python.sh"]
+  }
+
+  provisioner "shell-local" {
+    command = "./common-packer/ansible-galaxy.sh ${var.ansible_roles_path}"
+  }
+
+  provisioner "ansible" {
+    ansible_env_vars   = ["ANSIBLE_NOCOWS=1", "ANSIBLE_PIPELINING=True", "ANSIBLE_ROLES_PATH=${var.ansible_roles_path}", "ANSIBLE_CALLBACK_WHITELIST=profile_tasks", "ANSIBLE_STDOUT_CALLBACK=debug"]
+    command            = "./common-packer/ansible-playbook.sh"
+    extra_arguments    = ["--scp-extra-args", "'-O'", "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"]
+    playbook_file      = "provision/mininet-ovs-2.8.yaml"
+    skip_version_check = true
+  }
+}
index 17937e2c04c39e0d5c143423c384fb105f63aec4..3b9c75ec49b5193f81634c4f7ddff9e22f6e8541 100644 (file)
         "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
         "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
         "ANSIBLE_STDOUT_CALLBACK=debug"
+      ],
+      "extra_arguments": [
+        "--scp-extra-args", "'-O'",
+        "--ssh-extra-args",
+        "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
       ]
     }
   ]
diff --git a/packer/templates/robot.pkr.hcl b/packer/templates/robot.pkr.hcl
new file mode 100644 (file)
index 0000000..0815d96
--- /dev/null
@@ -0,0 +1,157 @@
+packer {
+  required_plugins {
+    openstack = {
+      version = ">= 1.0.0"
+      source  = "github.com/hashicorp/openstack"
+    }
+  }
+}
+
+variable "ansible_roles_path" {
+  type    = string
+  default = ".galaxy"
+}
+
+variable "arch" {
+  type    = string
+  default = "x86_64"
+}
+
+variable "base_image" {
+  type = string
+  default = null
+}
+
+variable "cloud_network" {
+  type = string
+  default = null
+}
+
+variable "cloud_region" {
+  type    = string
+  default = "ca-ymq-1"
+}
+
+variable "cloud_auth_url" {
+  type    = string
+  default = null
+}
+
+variable "cloud_tenant" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user" {
+  type    = string
+  default = null
+}
+
+variable "cloud_pass" {
+  type    = string
+  default = null
+}
+
+variable "cloud_user_data" {
+  type = string
+  default = null
+}
+
+variable "distro" {
+  type = string
+  default = null
+}
+
+variable "docker_source_image" {
+  type = string
+  default = null
+}
+
+variable "flavor" {
+  type    = string
+  default = "v3-standard-2"
+}
+
+variable "ssh_proxy_host" {
+  type    = string
+  default = ""
+}
+
+variable "source_ami_filter_name" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_product_code" {
+  type    = string
+  default = null
+}
+
+variable "source_ami_filter_owner" {
+  type    = string
+  default = null
+}
+
+variable "ssh_user" {
+  type = string
+}
+
+variable "vm_image_disk_format" {
+  type    = string
+  default = ""
+}
+
+variable "vm_use_block_storage" {
+  type    = string
+  default = "true"
+}
+
+variable "vm_volume_size" {
+  type    = string
+  default = "20"
+}
+
+source "docker" "robot" {
+  changes = ["ENTRYPOINT [\"\"]", "CMD [\"\"]"]
+  commit  = true
+  image   = "${var.docker_source_image}"
+}
+
+source "openstack" "robot" {
+  flavor            = "${var.flavor}"
+  image_disk_format = "${var.vm_image_disk_format}"
+  image_name        = "ZZCI - ${var.distro} - robot - ${var.arch} - ${legacy_isotime("20060102-150405.000")}"
+  instance_name     = "${var.distro}-robot-${uuidv4()}"
+  metadata = {
+    ci_managed = "yes"
+  }
+  networks                = ["${var.cloud_network}"]
+  region                  = "${var.cloud_region}"
+  source_image_name       = "${var.base_image}"
+  ssh_proxy_host          = "${var.ssh_proxy_host}"
+  ssh_username            = "${var.ssh_user}"
+  use_blockstorage_volume = "${var.vm_use_block_storage}"
+  user_data_file          = "${var.cloud_user_data}"
+  volume_size             = "${var.vm_volume_size}"
+}
+
+build {
+  sources = ["source.docker.robot", "source.openstack.robot"]
+
+  provisioner "shell" {
+    execute_command = "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    scripts         = ["common-packer/provision/install-python.sh"]
+  }
+
+  provisioner "shell-local" {
+    command = "./common-packer/ansible-galaxy.sh ${var.ansible_roles_path}"
+  }
+
+  provisioner "ansible" {
+    ansible_env_vars   = ["ANSIBLE_NOCOWS=1", "ANSIBLE_PIPELINING=True", "ANSIBLE_ROLES_PATH=${var.ansible_roles_path}", "ANSIBLE_CALLBACK_WHITELIST=profile_tasks", "ANSIBLE_STDOUT_CALLBACK=debug"]
+    command            = "./common-packer/ansible-playbook.sh"
+    extra_arguments    = ["--scp-extra-args", "'-O'", "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"]
+    playbook_file      = "provision/robot.yaml"
+    skip_version_check = true
+  }
+}