add ImageOS env variable

This commit is contained in:
Aleksandr Chebotov
2020-02-14 14:43:30 +03:00
parent caa49f8275
commit 8023952876
4 changed files with 12 additions and 4 deletions

View File

@@ -21,6 +21,7 @@
"vm_size": "Standard_DS2_v2",
"capture_name_prefix": "packer",
"image_version": "dev",
"image_os": "ubuntu16",
"github_feed_token": null
},
"sensitive-variables": ["client_secret", "github_feed_token"],
@@ -109,7 +110,8 @@
{
"type": "shell",
"inline": [
"echo ImageVersion={{user `image_version`}} | tee -a /etc/environment"
"echo ImageVersion={{user `image_version`}} | tee -a /etc/environment",
"echo ImageOS={{user `image_os`}} | tee -a /etc/environment"
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},