You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
- name: integration/ssh/password.yml
|
|
hosts: test-targets[0]
|
|
gather_facts: false
|
|
vars:
|
|
ansible_user: mitogen__user1
|
|
tasks:
|
|
- meta: reset_connection
|
|
- name: ansible_password
|
|
vars:
|
|
ansible_password: user1_password
|
|
ping:
|
|
|
|
- meta: reset_connection
|
|
- name: ansible_ssh_pass
|
|
vars:
|
|
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:
|
|
ignore_errors: true
|
|
ignore_unreachable: true
|
|
register: ssh_no_password_result
|
|
- assert:
|
|
that:
|
|
- ssh_no_password_result.unreachable == True
|
|
fail_msg: ssh_no_password_result={{ ssh_no_password_result }}
|
|
|
|
- meta: reset_connection
|
|
- name: ansible_ssh_pass should override ansible_password
|
|
ping:
|
|
vars:
|
|
ansible_password: wrong
|
|
ansible_ssh_pass: user1_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: Lower priority password variables should not override
|
|
vars:
|
|
ansible_password: user1_password
|
|
ansible_ssh_pass: user1_password
|
|
ansible_ssh_password: wrong
|
|
ping:
|
|
ignore_errors: true
|
|
ignore_unreachable: true
|
|
register: ssh_wrong_password_result
|
|
- assert:
|
|
that:
|
|
- ssh_wrong_password_result.unreachable == True
|
|
fail_msg: ssh_wrong_password_result={{ ssh_wrong_password_result }}
|