You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.
Currently trying to use terraform-provisioner-ansible with GCP
When creating vms in gcp using the provsioner would sometimes fail to ssh when a vm is not ready to be ssh'd into. Even if I try to set the connection attempts argument to a higher number. I still see ssh failures fairly quickly
It looks like ansible code based around this has changed a bit and its ignoring the argument ConnectionAttempts.
This can be worked around by setting the environment variable ANSIBLE_SSH_RETRIES before executing the ansible playbooks in terraform
Expected behavior
When setting Ansible SSH settings connection attempts I expect the provsioner/ansible to retry failed ssh connection attempts.
...
Actual behavior
When setting the connection attempts argument the terraform ansible provsioner is passing it in the ssh extra args as -o ConnectTimeout in the incorrect format.
...
I have the same issue here, even I add tasks in the playbook to wait for ssh it still fails. but when I re-run terraform apply it succeed.
- name: Wait for port 22 to become open and contain "OpenSSH"wait_for:
port: 22host: '{{ (ansible_ssh_host|default(ansible_host)|default(inventory_hostname) }}'search_regex: OpenSSHdelay: 15connection: local
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Steps to reproduce
Currently trying to use terraform-provisioner-ansible with GCP
When creating vms in gcp using the provsioner would sometimes fail to ssh when a vm is not ready to be ssh'd into. Even if I try to set the connection attempts argument to a higher number. I still see ssh failures fairly quickly
It looks like ansible code based around this has changed a bit and its ignoring the argument ConnectionAttempts.
Upon further inspection ansible no longer takes the argument -o ConnectionAttempts=20 inside the ssh-extra-args
There is now seems to be something called retries
https://github.com/ansible/ansible/blob/aa53eb0e7196c6c920e6326f5d11accfd077d151/lib/ansible/plugins/connection/ssh.py#L142
This can be worked around by setting the environment variable ANSIBLE_SSH_RETRIES before executing the ansible playbooks in terraform
Expected behavior
When setting Ansible SSH settings connection attempts I expect the provsioner/ansible to retry failed ssh connection attempts.
...
Actual behavior
When setting the connection attempts argument the terraform ansible provsioner is passing it in the ssh extra args as -o ConnectTimeout in the incorrect format.
...
Configuration
Terraform version:0.12.10
terraform-provisioner-ansible version/SHA:v2.3.3
Terraform file / provisioner configuration:
Terraform run log:
The text was updated successfully, but these errors were encountered: