diff --git a/examples/amazon/nginx_server/README.Md b/examples/amazon/nginx_server/README.Md new file mode 100644 index 000000000..27756eff7 --- /dev/null +++ b/examples/amazon/nginx_server/README.Md @@ -0,0 +1 @@ +command: packer build -var "accesskey=*" -var "secretkey=" -var "shellpath=packages.sh" .\nginx.json diff --git a/examples/amazon/nginx_server/nginx.json b/examples/amazon/nginx_server/nginx.json new file mode 100644 index 000000000..220789067 --- /dev/null +++ b/examples/amazon/nginx_server/nginx.json @@ -0,0 +1,34 @@ + + + +{ + "variables": + { + "accesskey": "", + "secretkey": "", + "shellpath": "packages.sh" + }, + "builders":[ + { + "type": "amazon-ebs", + "access_key": "{{user `accesskey`}}", + "secret_key": "{{user `secretkey`}}", + "region": "ap-south-1", + "source_ami": "ami-sa7608343426b", + "instance_type": "t2.micro", + "ssh_username": "ubuntu", + "ami_name": "nginx", + "tags": { + "OS_Version": "Ubuntu", + "Release": "Latest" + } + } + ], + "provisioners":[ + { + "type": "shell", + "script": "{{user `shellpath`}}" + } + ] + +} diff --git a/examples/amazon/nginx_server/packages.sh b/examples/amazon/nginx_server/packages.sh new file mode 100644 index 000000000..4ca676e9f --- /dev/null +++ b/examples/amazon/nginx_server/packages.sh @@ -0,0 +1,5 @@ +echo "installing nginx " +sudo apt-get update +sudo apt-get install nginx -y +sudo apt-get update +sudo service nginx restart