Merge "Add host/group vars"

This commit is contained in:
Zuul
2018-02-16 21:27:19 +00:00
committed by Gerrit Code Review
10 changed files with 201 additions and 70 deletions

View 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'

View File

@@ -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

View File

@@ -15,6 +15,7 @@
- python27
- faillocal
- check-vars
- check-hostvars
- check-secret-names
- timeout
- post-timeout