zuul/tests/fixtures/config/ansible/git/common-config/playbooks/check-hostvars.yaml

35 lines
699 B
YAML

- hosts: host1
tasks:
- name: Assert hostvar is present.
assert:
that:
- allvar == 'all'
- hostvar == 'host'
- groupvar is not defined
- hosts: host2
tasks:
- name: Assert groupvar is present.
assert:
that:
- allvar == 'all'
- hostvar is not defined
- groupvar == 'group'
- hosts: host3
tasks:
- name: Assert groupvar is present.
assert:
that:
- allvar == 'all'
- hostvar is not defined
- groupvar == 'group'
- hosts: group1
serial: 1
tasks:
- name: Assert groupvar is present.
assert:
that:
- groupvar == 'group'