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.
17 lines
388 B
YAML
17 lines
388 B
YAML
7 years ago
|
- hosts:
|
||
|
- testhost
|
||
|
- testhost2
|
||
|
gather_facts: no
|
||
|
vars:
|
||
|
secondhost: testhost2
|
||
|
tasks:
|
||
|
- name: Call the first role only on one host
|
||
|
include_role:
|
||
|
name: role1
|
||
|
when: inventory_hostname is match(secondhost)
|
||
|
|
||
|
- name: Make sure nothing else runs until role1 finishes
|
||
|
assert:
|
||
|
that:
|
||
|
- "'role1_complete' in hostvars[secondhost]"
|