Skip to content

Instantly share code, notes, and snippets.

@josephsindel
Created January 23, 2020 21:40
Show Gist options
  • Save josephsindel/9d88943e902b82d32d6901f097b546cc to your computer and use it in GitHub Desktop.
Save josephsindel/9d88943e902b82d32d6901f097b546cc to your computer and use it in GitHub Desktop.
$ cat ubuntu-metabase.json
{
"variables": {
"region" : "",
"subnet_id" : "subnet-e6d173ad"
},
"builders": [{
"source_ami_filter": {
"filters": {
"name": "ubuntu-base-*"
},
"owners": ["self"],
"most_recent": true
},
"type": "amazon-ebs",
"region" : "us-west-2",
"subnet_id" : "{{user `subnet_id`}}",
"iam_instance_profile" : "ec2-full-access-to-s3",
"instance_type" : "t2.micro",
"ssh_username" : "ubuntu",
"ami_name" : "ubuntu-metabase-{{timestamp}}",
"associate_public_ip_address": true,
"temporary_security_group_source_cidr" : "0.0.0.0/0",
"ssh_interface" : "public_ip"
}],
"provisioners": [
{
"type": "file",
"source": "scripts/metabase.service",
"destination": "/home/ubuntu/metabase.service"
},
{
"type": "file",
"source": "scripts/mb-envvars.sh",
"destination": "/home/ubuntu/mb-envvars.sh"
},
{
"type": "file",
"source": "scripts/metabase.tmpl",
"destination": "/home/ubuntu/metabase.tmpl"
},
{
"type": "shell",
"script": "scripts/ubuntu-metabase.sh",
"execute_command": "chmod +x {{ .Path }}; sudo -s {{ .Vars }} {{ .Path }}"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment