Just upgraded now
packer -v
1.1.0
Made a change to use "ssh_agent_auth" and added the below to my ssh config:
Host first.three.octets.*
IdentityFile ~/.ssh/cloudstack.pem
{
"builders": [{
"type": "cloudstack",
"api_url": "{{user `api_url`}}",
"api_key": "{{user `api_key`}}",
"network": "{{user `network`}}",
"secret_key": "{{user `secret_key`}}",
"service_offering": "{{user `service_offering`}}",
"source_template": "{{user `source_template`}}",
"template_os": "{{user `template_os`}}",
"zone": "{{user `zone`}}",
"instance_name": "{{ user `instance_name`}}-{{timestamp}}",
"template_name": "{{user `template_name`}}-{{timestamp}}",
"template_password_enabled": true,
"template_scalable": true,
"expunge": true,
"ssh_agent_auth": true,
"ssh_username": "{{user `ssh_username`}}",
"keypair": "{{user `keypair`}}"
}]
}
Now I get timeouts. Assuming the key, keypair and username are all correct,
is this a correct set up for configuring a connection using ssh key?
On Wednesday, September 13, 2017 at 4:36:24 PM UTC+1, Rickard von Essen
wrote:
>
> Are you running the latest version (released today). I have been working
> on some cloudstack improvements that was released now some of them involved
> improved ssh support.
>
> / Rickard
>
> On Sep 13, 2017 16:38, "David Curran" <[email protected] <javascript:>>
> wrote:
>
> I'm trying to automate the build process for templates and have run into
> an issue when trying to use a keypair.
>
> I've created a valid keypair in the API:
>
> (local) > list sshkeypairs
> count = 1
> sshkeypair:
> name = keyname
>
> I copied the output of the command used to create the key to a file as
> detailed in
> https://shankerbalan.net/blog/ssh-keys-on-cloudstack-guest-instances-using-cloud-init/
>
> This is my .json file:
>
> {
> "builders": [{
> "type": "cloudstack",
> "api_url": "{{user `api_url`}}",
> "api_key": "{{user `api_key`}}",
> "network": "{{user `network`}}",
> "secret_key": "{{user `secret_key`}}",
> "service_offering": "{{user `service_offering`}}",
> "source_template": "{{user `source_template`}}",
> "template_os": "{{user `template_os`}}",
> "zone": "{{user `zone`}}",
> "instance_name": "{{ user `instance_name`}}-{{timestamp}}",
> "template_name": "{{user `template_name`}}-{{timestamp}}",
> "template_password_enabled": true,
> "template_scalable": true,
> "expunge": true,
> "ssh_username": "{{user `ssh_username`}}",
> "ssh_private_key_file": "/root/to/cloudstack.pem",
> "keypair": "{{user `keypair`}}"
> }],
> }
>
> The variables are set in another file.
>
> With this configuration I am getting:
>
> ==> cloudstack: Waiting for SSH to become available...
> Build 'cloudstack' errored: unexpected EOF
>
> ==> Some builds didn't complete successfully and had errors:
> --> cloudstack: unexpected EOF
>
> I've also tried without the ssh_private_key_file setting but it hangs on
> waiting for SSH to become available and eventually times out.
> I am able to log in with the key file when I run packer and it is waiting
> for ssh to become available and checked that the public key matches that
> from http://vr/latest/public-keys
>
> Assuming I'm doing something stupid, is anyone able to point me in the
> right direction?
>
> many thanks.
>
> --
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/16a89b29-0d4d-4df2-bf71-ac3aa9e5514a%40googlegroups.com
>
> <https://groups.google.com/d/msgid/packer-tool/16a89b29-0d4d-4df2-bf71-ac3aa9e5514a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/packer-tool/f39de414-af3c-40d1-ac2a-5b271b4d85a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.