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.
mitogen/tests/ansible/integration/transport_config/password.yml

111 lines
2.7 KiB
YAML

# Each case is followed by mitogen_via= case to test hostvars method.
# When no ansible_ssh_pass/ansible_password= is set, password comes via
# interactive input.
- name: integration/transport_config/password.yml
hosts: tc-password-unset
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.password
right: "" # actually null, but assert_equal limitation
tags:
- mitogen_only
- hosts: tc-password-unset
vars: {mitogen_via: tc-password-explicit-ssh}
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.password
right: "ansi-ssh-pass"
- assert_equal:
left: out.result[1].kwargs.password
right: ""
tags:
- mitogen_only
# ansible_ssh_user=
- hosts: tc-password-explicit-ssh
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.password
right: "ansi-ssh-pass"
tags:
- mitogen_only
- hosts: tc-password-explicit-ssh
vars: {mitogen_via: tc-password-unset}
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.password
right: ""
- assert_equal:
left: out.result[1].kwargs.password
right: "ansi-ssh-pass"
tags:
- mitogen_only
# ansible_user=
- hosts: tc-password-explicit-pass
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.password
right: "ansi-pass"
tags:
- mitogen_only
- hosts: tc-password-explicit-pass
vars: {mitogen_via: tc-password-unset}
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.password
right: ""
- assert_equal:
left: out.result[1].kwargs.password
right: "ansi-pass"
tags:
- mitogen_only
# both; ansible_ssh_user= takes precedence according to play_context.py.
- hosts: tc-password-explicit-both
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.password
right: "c.b.a"
tags:
- mitogen_only
- hosts: tc-password-explicit-both
vars: {mitogen_via: tc-password-unset}
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.password
right: ""
- assert_equal:
left: out.result[1].kwargs.password
right: "c.b.a"
tags:
- mitogen_only