-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConnectionTimeout #373
Comments
Hi @dwizzle204! Thank you for your interest in the project! If there is a sufficient delay between Transport plugins are not currently used by the Kitchen-Terraform verifier plugin as it relies on InSpec to handle connection responsibilities. I think you should be able to use the driver:
name: terraform
command_timeout: 600
color: true
root_module_directory: terraform/
provisioner:
name: terraform
platforms:
- name: rhel7
os_type: linux
verifier:
name: terraform
systems:
- name: image
backend: ssh
proxy_command: ssh packer@<%= `terraform output host_ip -state terraform/terraform.tfstate.d/terraform.tfstate` %> -o 'ConnectionAttempts 10' -o 'ConnectTimeout 5' -W %h:%p
user: packer
key_files:
- packer-ssh-key
hosts_output: host_ip
sudo: true
reporter:
- junit:inspec_output.xml
input_files:
- test/integration/image/attributes.yml
suites:
- name: image |
Thanks for the response. I modified this slight as the order was off
But it looks like its trying to populate that info before the test vm is built
-----> Verifying ...
|
I forgot to mention the caveat that you will need to run |
It's clear to me that this experience is not great. We'll have to see if there's a better way to handle it through InSpec's transport interface. |
In the meantime I'm able to get around it by adding this to my terraform resource "null_resource" "add_delay" { |
a variant on this temporary workaround can be to use netcat, also works with multiple instances
where you have to replace the SOMETHING, INSTANCE, N with relevant values/references ;-) |
Is there anyway to specify connection attempts in the verifier?
It appears like kitchen is trying to login before the VM is accepting ssh connections....
If I don't do the destroy I can ssh into the server using the proper account without issue.
[SSH] connection failed, retrying in 1 seconds (#<Net::SSH::ConnectionTimeout: Net::SSH::ConnectionTimeout>)
[SSH] connection failed, retrying in 1 seconds (#<Errno::ECONNREFUSED: Connection refused - connect(2) for 10.84.4.29:22>)
[SSH] connection failed, retrying in 1 seconds (#<Errno::ECONNREFUSED: Connection refused - connect(2) for 10.84.4.29:22>)
[SSH] connection failed, retrying in 1 seconds (#<Errno::ECONNREFUSED: Connection refused - connect(2) for 10.84.4.29:22>)
$$$$$$ [SSH] connection failed, terminating (#<Errno::ECONNREFUSED: Connection refused - connect(2) for 10.84.4.29:22>)
Example kitchen file:
driver:
name: terraform
command_timeout: 600
color: true
root_module_directory: terraform/
provisioner:
name: terraform
platforms:
os_type: linux
transport:
name: ssh
connection_retries: 600
connection_retry_sleep: 10
max_wait_until_ready: 6000
verifier:
name: terraform
systems:
- name: image
backend: ssh
user: packer
key_files:
- packer-ssh-key
hosts_output: host_ip
sudo: true
reporter:
- junit:inspec_output.xml
input_files:
- test/integration/image/attributes.yml # attributes that were previously passed in here, now need to be in a file
suites:
The text was updated successfully, but these errors were encountered: