Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
moreati committed Oct 6, 2024
1 parent 8862936 commit 09c537c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 49 deletions.
21 changes: 1 addition & 20 deletions ansible_mitogen/plugins/connection/mitogen_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,14 @@
import sys

DOCUMENTATION = """
name: mitogen_ssh
author: David Wilson <[email protected]>
connection: mitogen_ssh
short_description: Connect over SSH via Mitogen
description:
- This connects using an OpenSSH client controlled by the Mitogen for
Ansible extension. It accepts every option the vanilla ssh plugin
accepts.
version_added: "2.5"
options:
ssh_args:
type: str
vars:
- name: ssh_args
- name: ansible_ssh_args
- name: ansible_mitogen_ssh_args
ssh_common_args:
type: str
vars:
- name: ssh_args
- name: ansible_ssh_common_args
- name: ansible_mitogen_ssh_common_args
ssh_extra_args:
type: str
vars:
- name: ssh_args
- name: ansible_ssh_extra_args
- name: ansible_mitogen_ssh_extra_args
"""

try:
Expand Down
58 changes: 29 additions & 29 deletions tests/ansible/integration/ssh/password.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
ansible_ssh_pass: user1_password
ping:

- meta: reset_connection
- name: ansible_ssh_password
vars:
ansible_ssh_password: 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
Expand All @@ -41,28 +41,28 @@
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:
# - 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 }}
# # 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 }}

0 comments on commit 09c537c

Please sign in to comment.