Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

neffs
Copy link

@neffs neffs commented Oct 11, 2024

SUMMARY

ssh connection plugin reads password from variables Link

  • ansible_password
  • ansible_ssh_pass
  • ansible_ssh_password

In synchronize ansible_ssh_password was missing, which was surprising, because it isn't documented for ansible.posix.synchronize

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ansible.posix.synchronize

ADDITIONAL INFORMATION

Copy link
Contributor

ssh connection reads password from variables ansible_password, ansible_ssh_pass and ansible_ssh_password. In synchronize ansible_ssh_password was missing.
@neffs neffs force-pushed the ansible_ssh_password branch from 46ecb84 to 3fe65ff Compare October 11, 2024 19:42
Copy link
Contributor

Copy link
Collaborator

@saito-hideki saito-hideki left a 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))
Copy link
Collaborator

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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here'

@saito-hideki saito-hideki added the change_request The PR has a change request from a reviewer label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change_request The PR has a change request from a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants