mirror of https://github.com/ansible/ansible.git
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.
30 lines
636 B
YAML
30 lines
636 B
YAML
6 years ago
|
---
|
||
|
- hosts: localhost
|
||
|
gather_facts: false
|
||
|
tasks:
|
||
|
- name: Hi
|
||
|
ping:
|
||
|
- hosts: [localhost, nonexistent]
|
||
|
ignore_unreachable: true
|
||
|
gather_facts: false
|
||
|
tasks:
|
||
|
- name: Hi
|
||
|
ping:
|
||
|
- hosts: nonexistent
|
||
|
ignore_unreachable: true
|
||
|
gather_facts: false
|
||
|
tasks:
|
||
|
- name: Hi
|
||
|
ping:
|
||
|
- name: This should print anyway
|
||
|
debug:
|
||
|
msg: This should print worked even though host was unreachable
|
||
|
- name: Hi
|
||
|
ping:
|
||
|
register: should_fail
|
||
|
- assert:
|
||
|
that:
|
||
|
- 'should_fail is unreachable'
|
||
|
- 'not (should_fail is skipped)'
|
||
|
- 'not (should_fail is failed)'
|