summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/integration/targets/delegate_to/delegate_with_fact_from_delegate_host.yml37
1 files changed, 28 insertions, 9 deletions
diff --git a/test/integration/targets/delegate_to/delegate_with_fact_from_delegate_host.yml b/test/integration/targets/delegate_to/delegate_with_fact_from_delegate_host.yml
index 1670398423..97b0d7d08c 100644
--- a/test/integration/targets/delegate_to/delegate_with_fact_from_delegate_host.yml
+++ b/test/integration/targets/delegate_to/delegate_with_fact_from_delegate_host.yml
@@ -1,18 +1,37 @@
-- name: ensure we can use fact on delegated host for connection info
+- name: create a dedicated broken host and a working copy of localhost to delegate to
hosts: localhost
gather_facts: no
tasks:
- - add_host: name=f31 bogus_user=notme ansible_connection=ssh ansible_host=4.2.2.2
+ - add_host:
+ name: busted
+ ansible_connection: ssh
+ ansible_host: localhost
+ ansible_port: 1
+ - add_host:
+ name: delegate_to_local
+ ansible_connection: local
+ ansible_python_interpreter: '{{ ansible_playbook_python }}'
- - name: if not overriding with delegated host info, will not be unreachable
+- name: play targets an unreachable host, delegates to a working one
+ hosts: busted
+ gather_facts: no
+ tasks:
+ - name: attempt to connect to a broken host
ping:
- timeout: 5
- delegate_to: f31
+ timeout: 5 # backstop for a tarpit port or dropped packets
ignore_errors: true
ignore_unreachable: true
- register: delping
+ register: broken_ping
+ - assert:
+ that:
+ - broken_ping is unreachable
+
+ - name: delegate to the valid host
+ ping:
+ delegate_to: delegate_to_local
+ register: delegated_ping
- - name: ensure that the expected happened
- assert:
+ - assert:
that:
- - delping is failed
+ - delegated_ping is success
+ - delegated_ping is reachable