Problem to solve
Hello all,
I have created a pipeline in gitlab which deploys a virtual machine on Openstack using terraform. I use ansible resource to configure the deployed vm.
${openstack_networking_floatingip_v2.floatip.address} variable to fetch the floating ip address of the vm created as its not fixed every time I deploy a vm.
I have created a gitlab runner on same openstack to run the pipeline so that the deployed vms would be reachable.
I have attached ssh key pair which will be injected into the vms while its creation. Please note that key pair is of the gitlab runner vm (as the creation will be triggered/executed inside of the gitlab runner). I have also passed private key file while running the ansible script.
When I trigger the pipeline I get this error:
UNREACHABLE! => {“changed”: false, “msg”: “Failed to connect to the host via ssh: ssh: connect to host No route to host”, “unreachable”: true}
But when I manually login into the gitlab-runner vm I can SSH to the deployed vm which means the SSH key pair is fine and there is not authentication issue here.
The issue is pipeline job. Am I missing out something? some configuration in gitlab?
PS: gitlab is reachable to the opnstack
Versions
Terraform version 1.7
Virtual Machine Os Ubuntu 22 LTS
Ansible [core 2.15.9]
I apologise if I wrote something useless I am pretty new at this. Any suggestion is much required. Thanks in advance:)