mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-28 17:02:05 +03:00
packer demo
This commit is contained in:
@@ -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"
|
||||||
|
}]
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y nginx docker.io vim lvm2
|
||||||
Reference in New Issue
Block a user