summaryrefslogtreecommitdiffstats
path: root/packer/templates
diff options
context:
space:
mode:
authorVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>2016-10-13 13:54:18 -0500
committerVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>2016-12-16 13:22:36 -0600
commita63e80093c52d4893e5709860919d0f27cd8c122 (patch)
tree101476228aea7e7acc21dbbda2c1b9203a0f022b /packer/templates
parent2a36c43a61bf8698491db42031121d0ef5d6f31f (diff)
Convert Vagrant to Packer
This converts all of the in use Vagrant definitions to Packer and allows us to build images and allow automated testing of images. Change-Id: Ic87cce4aa674146952efad325a42b095086426d0 Signed-off-by: Vanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
Diffstat (limited to 'packer/templates')
-rw-r--r--packer/templates/basebuild.json52
1 files changed, 52 insertions, 0 deletions
diff --git a/packer/templates/basebuild.json b/packer/templates/basebuild.json
new file mode 100644
index 00000000..426f290a
--- /dev/null
+++ b/packer/templates/basebuild.json
@@ -0,0 +1,52 @@
+{
+ "variables": {
+ "stack_tenant": null,
+ "stack_user": null,
+ "stack_pass": null,
+ "stack_network": null,
+
+ "base_image": null,
+ "cloud_user": null,
+ "distro": null,
+ "cloud_user_data": null
+ },
+ "builders": [
+ {
+ "type": "openstack",
+ "identity_endpoint": "https://auth.vexxhost.net/v2.0/",
+ "tenant_name": "{{user `stack_tenant`}}",
+ "username": "{{user `stack_user`}}",
+ "password": "{{user `stack_pass`}}",
+ "region": "ca-ymq-1",
+ "ssh_username": "{{user `cloud_user`}}",
+ "image_name": "{{user `distro`}} - basebuild - {{isotime \"20060102-1504\"}}",
+ "source_image_name": "{{user `base_image`}}",
+ "flavor": "v1-standard-1",
+ "availability_zone": "ca-ymq-2",
+ "networks": [
+ "{{user `stack_network`}}"
+ ],
+ "user_data_file": "{{user `cloud_user_data`}}"
+ }
+ ],
+ "provisioners": [
+ {
+ "type": "shell",
+ "inline": ["mkdir -p /tmp/packer"]
+ },
+ {
+ "type": "file",
+ "source": "provision/basebuild/",
+ "destination": "/tmp/packer"
+ },
+ {
+ "type": "shell",
+ "scripts": [
+ "provision/baseline.sh",
+ "provision/basebuild.sh",
+ "provision/system_reseal.sh"
+ ],
+ "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+ }
+ ]
+}