From 04c5cded1bc89a0616fbdd40c0f51307a206d741 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Mon, 17 Oct 2016 12:02:03 +0000 Subject: [PATCH] packer demo --- packer-demo/example.json | 22 ++++++++++++++++++++++ packer-demo/scripts/install_software.sh | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 packer-demo/example.json create mode 100644 packer-demo/scripts/install_software.sh diff --git a/packer-demo/example.json b/packer-demo/example.json new file mode 100644 index 0000000..b7e2acb --- /dev/null +++ b/packer-demo/example.json @@ -0,0 +1,22 @@ +{ + "variables": { + "aws_access_key": "", + "aws_secret_key": "" + }, + "builders": [{ + "type": "amazon-ebs", + "access_key": "{{user `aws_access_key`}}", + "secret_key": "{{user `aws_secret_key`}}", + "region": "eu-west-1", + "source_ami": "ami-844e0bf7", + "instance_type": "t2.micro", + "ssh_username": "ubuntu", + "ami_name": "packer-example {{timestamp}}" + }], + "provisioners": [{ + "type": "shell", + "scripts": [ "scripts/install_software.sh" ], + "execute_command": "{{ .Vars }} sudo -E sh '{{ .Path }}'", + "pause_before": "10s" + }] +} diff --git a/packer-demo/scripts/install_software.sh b/packer-demo/scripts/install_software.sh new file mode 100644 index 0000000..41537ff --- /dev/null +++ b/packer-demo/scripts/install_software.sh @@ -0,0 +1,3 @@ +#!/bin/bash +apt-get update +apt-get install -y nginx docker.io vim lvm2