-
Notifications
You must be signed in to change notification settings - Fork 152
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
Add ansible_ssh_password as alias for ansible_ssh_pass variable #577
base: main
Are you sure you want to change the base?
Conversation
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 40s |
ssh connection reads password from variables ansible_password, ansible_ssh_pass and ansible_ssh_password. In synchronize ansible_ssh_password was missing.
46ecb84
to
3fe65ff
Compare
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 2m 52s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your pull request.
I have left two comments as a change request.
Also, in accordance with the community guidelines, a changelog fragment file is required for all PR.
Therefore, could you add a changelog fragment file to this PR? You can see more details here: Making your PR merge-worthy
You can write a short description for this PR in the bugfixes section.
For example: https://github.com/ansible-collections/ansible.posix/blob/main/changelogs/fragments/570_nfs4_acl.yml
password = task_vars.get('ansible_ssh_pass', None) or task_vars.get('ansible_password', None) | ||
password = (task_vars.get('ansible_ssh_password', None) | ||
or task_vars.get('ansible_ssh_pass', None) | ||
or task_vars.get('ansible_password', None)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This order is the password priority order. In this case, this logic is a first match, so how about this order based on the documents as follows: https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/connection/ssh.py#L61-L64
vars:
- name: ansible_password
- name: ansible_ssh_pass
- name: ansible_ssh_password
password = dest_host_inventory_vars.get('ansible_ssh_pass', None) or dest_host_inventory_vars.get('ansible_password', None) | ||
password = (dest_host_inventory_vars.get('ansible_ssh_password', None) | ||
or dest_host_inventory_vars.get('ansible_ssh_pass', None) | ||
or dest_host_inventory_vars.get('ansible_password', None)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here'
SUMMARY
ssh connection plugin reads password from variables Link
In synchronize ansible_ssh_password was missing, which was surprising, because it isn't documented for ansible.posix.synchronize
ISSUE TYPE
COMPONENT NAME
ansible.posix.synchronize
ADDITIONAL INFORMATION