An ssh_username must be specified
Note: some builders used to default ssh_username to "root".
Packer's documentation states that I may need to add a ssh_username to the Google Cloud builder. However, Google usernames are in the format of an email address; when i set ssh_username to a valid email address that has been authenticated to Google Cloud, Packer reports this as an error of incorrect format.
Can someone please point me in the direction where i can find appropriate documentation to setup ssh_username correctly and to promote to sudo?
Note, I have tried authenticating with a service key without joy. Using a service key is my preferred option.
{
"variables": {
"git_commit": "",
"git_branch": "",
"account_file": "test/test-******.json",
"project_id": "test-11211"
},
"builders": [
{
"type": "googlecompute",
"account_file": "{{user `account_file`}}",
"project_id": "{{user `project_id`}}",
"source_image": "ubuntu-1404-trusty-v20161213",
"zone": "us-central1-a",
"image_name": "redmine-{{timestamp}}-{{user `git_branch`}}-{{user `git_commit`}}"
}
],
"provisioners": [
{
"type": "chef-solo",
"install_command": "apt-get update && apt-get install -y curl && curl -L https://www.opscode.com/chef/install.sh | {{if .Sudo}}sudo{{end}} bash",
"cookbook_paths": ["chef/site-cookbooks"],
"run_list": [
"recipe[rails-sample]",
"recipe[rails-sample::user]",
"recipe[rails-sample::ruby]",
"recipe[rails-sample::app]"
]
}
]
}
Cheers
And
"builders": [
{
"type": "googlecompute",
"account_file": "{{user `account_file`}}",
"project_id": "{{user `project_id`}}",
"source_image": "ubuntu-1404-trusty-v20161213",
"zone": "us-central1-a",
"image_name": "redmine-{{timestamp}}-{{user `git_branch`}}-{{user `git_commit`}}",
"ssh_username": "root"
}
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/82b7ee9e-c56c-4a76-afbf-08dc109f1c17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAHqq0ew3-7pZsS_Gbp-X-WKjB_E4vjOoBD0%2B4Tj0yNt0utDCHw%40mail.gmail.com.