packer demo

This commit is contained in:
Edward Viaene
2016-10-17 12:02:03 +00:00
parent 7d9a910383
commit 04c5cded1b
2 changed files with 25 additions and 0 deletions
+22
View File
@@ -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"
}]
}
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
apt-get update
apt-get install -y nginx docker.io vim lvm2