-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
fix(tasks: synchronize): wrap in sshpass if ssh password was provided #30743
Conversation
a443665
to
d516b7c
Compare
Sorry that seem to not work for me. Maybe I am testing not to right version. I did:
and ran my playbook. `TASK [openhab : Sync config] ****************************************************************************************** PLAY RECAP ************************************************************************************************************ |
@xrow could you extract from your playbook the exact block which will allow me to reproduce this problem? and also the host variables used (not their values, but just to know if ansible_password, andsible_become and so on are set or not) |
Thank for your feedback. Here is some test code/output: First run remote (fails), second fails. Local is a vagrant box and remote a rasberry.
playbook
|
Sorry and hosts:
|
By the way, if I which to key based auth it works. |
@xrow could it be the case what password authentication for root is disabled on the server? are you able to manually run rsync with the same credentials? |
To what setting are you refferring? If you are referring to sshd config, the sample echo task shouldn`t have been executed, correct? |
This works by the way:
|
also i've just revisited the log you've attached above and saw a strange thing: "cmd": "/bin/rsync --delay-updates -F --compress --delete-after --archive --rsh=/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null --rsync-path=sudo rsync --out-format=<>%i %n%L /scm/smarthome.infrastructure/roles/openhab/files/conf/ root@centos-rpi3.xrow.lan:/etc/openhab/",
while in my case it was "cmd": "sshpass -p ******** /usr/sbin/rsync --delay-updates -F --compress --archive --rsh=/usr/sbin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null --rsync-path=sudo rsync --out-format=<<CHANGED>>%i %n%L /home/user/testfile user@192.168.1.3:/opt/testfile" |
mb try creating a new virtualenv and running ansible task there isolated? $ virtualenv -p python2 env
$ source env/bin/activate
(env)$ pip install git+git://github.com/actionless/ansible@rsync-password-fix
(env)$ which ansible-playbook # just to double-check what we're using ansible from the virtualenv
(env)$ ansible-playbook ....... |
my ansible version is 2.3.2.0 |
…process.Popen remove unused import
There are a few modules that need to use Something like:
Note: we try to keep that file sorted by file path |
@sivel and what do you think about the solution proposed in the latest commits? |
… of subprocess.Popen pass_fds only if they passed to run_command()
at the moment only |
I only used the change requested to stop the automatic rebuild_merge
rebuild_merge |
aws tests are still unstable |
rebuild_merge |
@maxamillion aws still unstable but after this testrun also |
rebuild_merge Dear CI Gods, please be kind. |
rebuild_merge |
🎆 🌵 🐱 🚬 🎆 |
…ansible#30743) * fix(tasks: synchronize): wrap in sshpass if ssh password was provided Closes ansible#16616 * fix(tasks: synchronize): pass rsync password to sshpass via fd * fix(tasks: synchronize): use fail_json instead of AnsibleError * fixup! fix(tasks: synchronize): use fail_json instead of AnsibleError fix python2 handling * feat(module_utils: basic: run_command): add optional arguments `pass_fds` and `before_communicate_callback` * fix(tasks: synchronize): use module.run_command instead of subprocess.Popen * fixup! fix(tasks: synchronize): use module.run_command instead of subprocess.Popen remove unused import * fixup! fixup! fix(tasks: synchronize): use module.run_command instead of subprocess.Popen pass_fds only if they passed to run_command()
…ansible#30743) * fix(tasks: synchronize): wrap in sshpass if ssh password was provided Closes ansible#16616 * fix(tasks: synchronize): pass rsync password to sshpass via fd * fix(tasks: synchronize): use fail_json instead of AnsibleError * fixup! fix(tasks: synchronize): use fail_json instead of AnsibleError fix python2 handling * feat(module_utils: basic: run_command): add optional arguments `pass_fds` and `before_communicate_callback` * fix(tasks: synchronize): use module.run_command instead of subprocess.Popen * fixup! fix(tasks: synchronize): use module.run_command instead of subprocess.Popen remove unused import * fixup! fixup! fix(tasks: synchronize): use module.run_command instead of subprocess.Popen pass_fds only if they passed to run_command()
SUMMARY
Fixes #16616
ISSUE TYPE
COMPONENT NAME
synchronize
ANSIBLE VERSION
(could be easily backported to older versions if needed)