packer-cn/examples/ucloud/ubuntu.json

30 lines
812 B
JSON
Raw Normal View History

2019-06-27 02:10:26 -04:00
{
2019-06-27 02:28:46 -04:00
"variables": {
"ucloud_public_key": "{{env `UCLOUD_PUBLIC_KEY`}}",
"ucloud_private_key": "{{env `UCLOUD_PRIVATE_KEY`}}",
"ucloud_project_id": "{{env `UCLOUD_PROJECT_ID`}}"
},
2019-06-27 02:10:26 -04:00
2019-06-27 02:28:46 -04:00
"builders": [{
"type": "ucloud-uhost",
"public_key": "{{user `ucloud_public_key`}}",
"private_key": "{{user `ucloud_private_key`}}",
"project_id": "{{user `ucloud_project_id`}}",
"region": "cn-bj2",
"availability_zone": "cn-bj2-02",
"instance_type": "n-basic-2",
"source_image_id": "uimage-irofn4",
"ssh_password": "ucloud_2019",
"ssh_username": "ubuntu",
"image_name": "packer-test-ubuntu-bj"
}],
2019-06-27 02:10:26 -04:00
2019-06-27 02:28:46 -04:00
"provisioners": [{
"type": "shell",
"inline": [
"sleep 30",
"echo 'ucloud_2019' | sudo -S apt update",
"sudo apt install nginx -y"
]
}]
2019-06-27 02:10:26 -04:00
}