HCL-TECH-SOFTWARE / connections-automation

Deployment and upgrade automation scripts for HCL Connections 7.0 based on Ansible

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problem with rsync authentication - TASK [setup-kubectl : Copy .kube to controller]

MagnaFrisia90 opened this issue · comments

"ansible-playbook -i environments/examples/cnx7/quick_start/inventory.ini playbooks/setup-component-pack-infra-only.yml"
When setting up Kubernetes the following error is printed for the task:

TASK [setup-kubectl : Copy .kube to controller] ******************************************************************************
fatal: [solcon15.solvito.cloud]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive r/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null --rsync-path=sudo rsync --out-format=<>olcon15.solvito.cloud:/home/ansible/.kube /tmp/.kube_solcon15.solvito.cloud", "msg": "Warning: Permanently added 'solcon15.sold,172.16.10.107' (ECDSA) to the list of known hosts.\r\nprotocol version mismatch -- is your shell clean?\n(see the rsync man an explanation)\nrsync error: protocol incompatibility (code 2) at compat.c(178) [Receiver=3.1.2]\n", "rc": 2}

I assume this is caused by rsync asking for authentication inside the shell call. But why ?
My assumption was that all these parameters like "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" would intercept these prompts.
I am trying to install a single-node k8s.

Wondering using the same user running the playbook, if you manually run rsync to copy a file over to solcon15.solvito.cloud does it go smoothly?

What command exactly ?
solcon13=ansible; solcon15=k8s master
When I run a similar command manually it is the same result:

[ansible@solcon13 ~]$ rsync solcon15.solvito.cloud:/home/ansible/1.txt ./1.txt
Warning: Permanently added 'solcon15.solvito.cloud,172.16.10.107' (ECDSA) to the list of known hosts.
protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(178) [Receiver=3.1.2]

I found the cause for this issue. I followed the documentation....
Based on https://github.com/HCL-TECH-SOFTWARE/connections-automation/blob/main/documentation/QUICKSTART.md you should add "eval "$(ssh-agent)" " to .bashrc.
But this actually causes a line to be printed when opening the shell. And this Agent-PID-information then crashes the resync.

Thanks for reporting, I think in this case doing this in .bashrc instead would work.

if shopt -q login_shell; then
  eval "$(ssh-agent)"
fi

I did not verify this configuration but I worked around skipping the "eval "$(ssh-agent)" part as this does not seem to be mandatory