Skip to content

Commit

Permalink
tests: Coverage of support for ansible_ssh_password variable
Browse files Browse the repository at this point in the history
  • Loading branch information
moreati committed Sep 11, 2024
1 parent f5e161f commit 7eb88d5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Unreleased
NB: play or task scoped variables will probably still fail.
* :gh:issue:`694` CI: Fixed a race condition and some resource leaks causing
some of intermittent failures when running the test suite.
* :gh:issue:`1106` Support `ansible_ssh_password` variable


v0.3.9 (2024-08-13)
Expand Down
1 change: 1 addition & 0 deletions docs/contributors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ sponsorship and outstanding future-thinking of its early adopters.
<li>Lewis Bellwood &mdash; <em>Happy to be apart of a great project.</em></li>
<li>luto</li>
<li><a href="https://mayeu.me/">Mayeu a.k.a Matthieu Maury</a></li>
<li><a href="https://github.com/madsi1m">Michael D'Silva</a></li>
<li><a href="https://twitter.com/nathanhruby">@nathanhruby</a></li>
<li><a href="https://github.com/opoplawski">Orion Poplawski</a></li>
<li><a href="https://github.com/philfry">Philippe Kueck</a></li>
Expand Down
21 changes: 18 additions & 3 deletions tests/ansible/integration/ssh/password.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
ansible_ssh_pass: user1_password
ping:

- meta: reset_connection
- name: ansible_ssh_password
vars:
ansible_ssh_password: user1_password
ping:

- meta: reset_connection
- name: absent password should fail
ping:
Expand All @@ -34,13 +40,22 @@
ansible_password: wrong
ansible_ssh_pass: user1_password

# Tests that ansible_ssh_pass has priority over ansible_password
- meta: reset_connection
- name: Highest priority password variable should override all others
vars:
ansible_password: wrong
ansible_ssh_pass: wrong
ansible_ssh_password: user1_password
ping:

# Tests that ansible_ssh_password has priority over others
# and that a wrong password causes a target to be marked unreachable.
- meta: reset_connection
- name: ansible_password should not override
- name: Lower priority password variables should not override
vars:
ansible_password: user1_password
ansible_ssh_pass: wrong
ansible_ssh_pass: user1_password
ansible_ssh_password: wrong
ping:
ignore_errors: true
ignore_unreachable: true
Expand Down

0 comments on commit 7eb88d5

Please sign in to comment.