Short background;
I have created a Jenkins master on EC2 and attached a Kubernetes cluster as worker (Amazon EKS).
I have used Kubernetes plugin and created an jnlp slave image that mimics the master's installations, versions and prerequisites.
Everything worked as expected untill I have executed the 'wait_for_connection' module, right after instance creation;
- name: Wait for system to become reachable
hosts: just_created
remote_user: "{{ remote_image_user }}"
gather_facts: false
become: True
become_user: root
vars:
remote_image_user: "ec2-user"
tasks:
- name: Wait for system to become reachable
wait_for_connection:
The time out error recieved from the worker pod:
fatal: FAILED! => {"changed": false, "elapsed": 600, "msg": "timed out waiting for ping module test success: Error reading SSH protocol banner"}
Additional information:
ansible 2.7.10
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.8 (default, Jun 16 2020, 13:32:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
What do i miss? why ansible struggles to SSH from within the pod to another host?
For those who face the same issue, I found the cause for this, some changes to to be made to the ansible.cfg:
host_key_checking = False
record_host_keys=False