66 lines
1.7 KiB
JSON
66 lines
1.7 KiB
JSON
{
|
|
"variables": {
|
|
"admin_password": "{{env `ADMIN_PASSWORD`}}",
|
|
"admin_ssh_public_key_file": "{{env `ADMIN_SSH_PUBLIC_KEY_FILE`}}",
|
|
"deploy_ssh_public_key_file": "{{env `DEPLOY_SSH_PUBLIC_KEY_FILE`}}"
|
|
},
|
|
"builders": [
|
|
{
|
|
"type": "amazon-ebs",
|
|
"source_ami_filter": {
|
|
"filters": {
|
|
"virtualization-type": "hvm",
|
|
"root-device-type": "ebs",
|
|
"name": "ubuntu/images/hvm-ssd/ubuntu-groovy-20.10-amd64-server-*"
|
|
},
|
|
"owners": ["099720109477"],
|
|
"most_recent": true
|
|
},
|
|
"instance_type": "t3.micro",
|
|
"ssh_username": "ubuntu",
|
|
"ami_name": "riju-{{timestamp}}"
|
|
}
|
|
],
|
|
"provisioners": [
|
|
{
|
|
"type": "shell",
|
|
"script": "validate.bash",
|
|
"environment_vars": [
|
|
"ADMIN_PASSWORD={{user `admin_password`}}",
|
|
"ADMIN_SSH_PUBLIC_KEY_FILE={{user `admin_ssh_public_key_file`}}",
|
|
"DEPLOY_SSH_PUBLIC_KEY_FILE={{user `deploy_ssh_public_key_file`}}"
|
|
]
|
|
},
|
|
{
|
|
"type": "file",
|
|
"source": "riju",
|
|
"destination": "/tmp/riju"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"source": "riju-deploy",
|
|
"destination": "/tmp/riju-deploy"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"source": "riju.service",
|
|
"destination": "/tmp/riju.service"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"source": "{{user `admin_ssh_public_key_file`}}",
|
|
"destination": "/tmp/id_admin.pub"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"source": "{{user `deploy_ssh_public_key_file`}}",
|
|
"destination": "/tmp/id_deploy.pub"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"script": "provision.bash",
|
|
"environment_vars": ["ADMIN_PASSWORD={{user `admin_password`}}"]
|
|
}
|
|
]
|
|
}
|