added packer template file

pull/1/head
Tiago Faria 2018-06-21 23:10:39 +01:00 committed by GitHub
parent 29b44c073c
commit 4d0abf6811
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 54 additions and 0 deletions

54
dev/packer.json Normal file
View File

@ -0,0 +1,54 @@
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"destination_regions": "eu-west-1,eu-west-2,eu-west-3,eu-central-1,us-east-1,us-west-1,ap-northeast-1,sa-east-1",
"hostname": "misp"
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "eu-west-1",
"ami_groups": "all",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"instance_type": "t2.micro",
"ami_regions": "{{user `destination_regions`}}",
"ssh_username": "ubuntu",
"ami_name": "MISP-{{timestamp}}",
"ami_description": "MISP - Malware Information Sharing Platform",
"tags": {
"Amazon_AMI_Management_Identifier": "misp-build"
}
}],
"provisioners": [
{
"type": "shell",
"execute_command": "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"inline":[
"echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers"
]
},
{
"type": "shell",
"execute_command" : "echo '{{user `ssh_pass`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"script": "/home/ubuntu/misp/bootstrap",
"pause_before": "10s"
}
],
"post-processors":[{
"type": "amazon-ami-management",
"regions": "{{user `destination_regions`}}",
"identifier": "misp-build",
"keep_releases": "1"
}
]
}