summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/wait_for_connection/tasks/main.yml
blob: 19749e686e56ca867318caad6d7717f97e7e2761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- name: Test normal connection to target node
  wait_for_connection:
    connect_timeout: 5
    sleep: 1
    timeout: 10

- name: Test normal connection to target node with delay
  wait_for_connection:
    connect_timeout: 5
    sleep: 1
    timeout: 10
    delay: 3
  register: result

- name: Verify delay was honored
  assert:
    that:
      - result.elapsed >= 3

- name: Use invalid parameter
  wait_for_connection:
    foo: bar
  ignore_errors: yes
  register: invalid_parameter

- name: Ensure task fails with error
  assert:
    that:
    - invalid_parameter is failed
    - "invalid_parameter.msg == 'Invalid options for wait_for_connection: foo'"