From a63e80093c52d4893e5709860919d0f27cd8c122 Mon Sep 17 00:00:00 2001 From: Vanessa Rene Valderrama Date: Thu, 13 Oct 2016 13:54:18 -0500 Subject: 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 --- packer/templates/basebuild.json | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 packer/templates/basebuild.json (limited to 'packer/templates') diff --git a/packer/templates/basebuild.json b/packer/templates/basebuild.json new file mode 100644 index 000000000..426f290af --- /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" + } + ] +} -- cgit 1.2.3-korg