Merge "Add host/group vars"
This commit is contained in:
26
tests/fixtures/config/ansible/git/common-config/playbooks/check-hostvars.yaml
vendored
Normal file
26
tests/fixtures/config/ansible/git/common-config/playbooks/check-hostvars.yaml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
- 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'
|
||||
@@ -119,6 +119,32 @@
|
||||
- vartest_site
|
||||
- vartest_secret
|
||||
|
||||
- job:
|
||||
parent: python27
|
||||
name: check-hostvars
|
||||
run: playbooks/check-hostvars.yaml
|
||||
nodeset:
|
||||
nodes:
|
||||
- name: host1
|
||||
label: ubuntu-xenial
|
||||
- name: host2
|
||||
label: ubuntu-xenial
|
||||
- name: host3
|
||||
label: ubuntu-xenial
|
||||
groups:
|
||||
- name: group1
|
||||
nodes:
|
||||
- host2
|
||||
- host3
|
||||
vars:
|
||||
allvar: all
|
||||
host_vars:
|
||||
host1:
|
||||
hostvar: host
|
||||
group_vars:
|
||||
group1:
|
||||
groupvar: group
|
||||
|
||||
- job:
|
||||
parent: python27
|
||||
name: check-secret-names
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
- python27
|
||||
- faillocal
|
||||
- check-vars
|
||||
- check-hostvars
|
||||
- check-secret-names
|
||||
- timeout
|
||||
- post-timeout
|
||||
|
||||
Reference in New Issue
Block a user