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.
102 lines
2.6 KiB
YAML
102 lines
2.6 KiB
YAML
![]()
6 years ago
|
# Each case is followed by mitogen_via= case to test hostvars pass.
|
||
|
|
||
|
|
||
|
# No port set
|
||
|
- name: integration/transport_config/port.yml
|
||
|
hosts: tc-port-unset
|
||
|
tasks:
|
||
|
- include: ../_mitogen_only.yml
|
||
|
- {mitogen_get_stack: {}, register: out}
|
||
|
- assert:
|
||
|
that:
|
||
|
- out.result|length == 1
|
||
|
- out.result[0].method == "ssh"
|
||
|
- out.result[0].kwargs.port == None
|
||
|
|
||
|
# Not set, mitogen_via=
|
||
|
- hosts: tc-port-explicit-ssh
|
||
|
vars: {mitogen_via: tc-port-unset}
|
||
|
tasks:
|
||
|
- include: ../_mitogen_only.yml
|
||
|
- {mitogen_get_stack: {}, register: out}
|
||
|
- assert:
|
||
|
that:
|
||
|
- out.result|length == 2
|
||
|
- out.result[0].method == "ssh"
|
||
|
- out.result[0].kwargs.port == None
|
||
|
- out.result[1].method == "ssh"
|
||
|
- out.result[1].kwargs.port == 4321
|
||
|
|
||
|
# ansible_ssh_port=
|
||
|
- hosts: tc-port-explicit-ssh
|
||
|
tasks:
|
||
|
- include: ../_mitogen_only.yml
|
||
|
- {mitogen_get_stack: {}, register: out}
|
||
|
- assert:
|
||
|
that:
|
||
|
- out.result|length == 1
|
||
|
- out.result[0].method == "ssh"
|
||
|
- out.result[0].kwargs.port == 4321
|
||
|
|
||
|
- hosts: tc-port-explicit-unset
|
||
|
vars: {mitogen_via: tc-port-explicit-ssh}
|
||
|
tasks:
|
||
|
- include: ../_mitogen_only.yml
|
||
|
- {mitogen_get_stack: {}, register: out}
|
||
|
- assert:
|
||
|
that:
|
||
|
- out.result|length == 2
|
||
|
- out.result[0].method == "ssh"
|
||
|
- out.result[1].kwargs.port == 4321
|
||
|
- out.result[1].method == "ssh"
|
||
|
- out.result[0].kwargs.port == None
|
||
|
|
||
|
# ansible_port=
|
||
|
- hosts: tc-port-explicit-port
|
||
|
tasks:
|
||
|
- include: ../_mitogen_only.yml
|
||
|
- {mitogen_get_stack: {}, register: out}
|
||
|
- assert:
|
||
|
that:
|
||
|
- out.result|length == 1
|
||
|
- out.result[0].method == "ssh"
|
||
|
- out.result[0].kwargs.port == 1234
|
||
|
|
||
|
- hosts: tc-port-unset
|
||
|
vars: {mitogen_via: tc-port-explicit-port}
|
||
|
tasks:
|
||
|
- include: ../_mitogen_only.yml
|
||
|
- {mitogen_get_stack: {}, register: out}
|
||
|
- assert:
|
||
|
that:
|
||
|
- out.result|length == 2
|
||
|
- out.result[0].method == "ssh"
|
||
|
- out.result[0].kwargs.port == 1234
|
||
|
- out.result[1].method == "ssh"
|
||
|
- out.result[1].kwargs.port == None
|
||
|
|
||
|
|
||
|
# both, ssh takes precedence
|
||
|
- hosts: tc-port-both
|
||
|
tasks:
|
||
|
- include: ../_mitogen_only.yml
|
||
|
- {mitogen_get_stack: {}, register: out}
|
||
|
- assert:
|
||
|
that:
|
||
|
- out.result|length == 1
|
||
|
- out.result[0].method == "ssh"
|
||
|
- out.result[0].kwargs.port == 1532
|
||
|
|
||
|
- hosts: tc-port-unset
|
||
|
vars: {mitogen_via: tc-port-both}
|
||
|
tasks:
|
||
|
- include: ../_mitogen_only.yml
|
||
|
- {mitogen_get_stack: {}, register: out}
|
||
|
- assert:
|
||
|
that:
|
||
|
- out.result|length == 2
|
||
|
- out.result[0].method == "ssh"
|
||
|
- out.result[0].kwargs.port == 1532
|
||
|
- out.result[1].method == "ssh"
|
||
|
- out.result[1].kwargs.port == None
|