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/remote_addr.yml

112 lines
2.8 KiB
YAML

# Each case is followed by mitogen_via= case to test hostvars method.
# When no ansible_host/ansible_ssh_host= is set, hostname is same as inventory
# name.
- name: integration/transport_config/remote_addr.yml
hosts: tc-remote-addr-unset
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.hostname
right: "tc-remote-addr-unset"
tags:
- mitogen_only
- hosts: tc-remote-addr-unset
vars: {mitogen_via: tc-remote-addr-explicit-ssh}
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.hostname
right: "ansi.ssh.host"
- assert_equal:
left: out.result[1].kwargs.hostname
right: "tc-remote-addr-unset"
tags:
- mitogen_only
# ansible_ssh_host=
- hosts: tc-remote-addr-explicit-ssh
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.hostname
right: "ansi.ssh.host"
tags:
- mitogen_only
- hosts: tc-remote-addr-explicit-ssh
vars: {mitogen_via: tc-remote-addr-unset}
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.hostname
right: "tc-remote-addr-unset"
- assert_equal:
left: out.result[1].kwargs.hostname
right: "ansi.ssh.host"
tags:
- mitogen_only
# ansible_host=
- hosts: tc-remote-addr-explicit-host
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.hostname
right: "ansi.host"
tags:
- mitogen_only
- hosts: tc-remote-addr-explicit-host
vars: {mitogen_via: tc-remote-addr-unset}
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.hostname
right: "tc-remote-addr-unset"
- assert_equal:
left: out.result[1].kwargs.hostname
right: "ansi.host"
tags:
- mitogen_only
# both; ansible_ssh_host= takes precedence according to play_context.py.
- hosts: tc-remote-addr-explicit-both
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.hostname
right: "a.b.c"
tags:
- mitogen_only
- hosts: tc-remote-addr-explicit-both
vars: {mitogen_via: tc-remote-addr-unset}
tasks:
- include_tasks: ../_mitogen_only.yml
- {mitogen_get_stack: {}, register: out}
- assert_equal:
left: out.result[0].kwargs.hostname
right: "tc-remote-addr-unset"
- assert_equal:
left: out.result[1].kwargs.hostname
right: "a.b.c"
tags:
- mitogen_only