Create nodepool dictionary for ansible inventory

This moves our nodepool variables more inline with how we handle our
zuul ansible variables. Both will now be a dict.

Change-Id: I069203328cce0bc2d4bf31f31351209bf2b6cb5a
Depends-On: Ia13e6e9e89d24ac3c9c62a0286fba0279b5408b3
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-06-13 11:53:13 -04:00
parent 1f7ebe983d
commit 16912d9e8a
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
2 changed files with 7 additions and 6 deletions

View File

@ -3,9 +3,9 @@
- name: Assert nodepool variables are valid.
assert:
that:
- nodepool_az == 'test-az'
- nodepool_region == 'test-region'
- nodepool_provider == 'test-provider'
- nodepool.az == 'test-az'
- nodepool.region == 'test-region'
- nodepool.provider == 'test-provider'
- name: Assert zuul-executor variables are valid.
assert:

View File

@ -903,9 +903,10 @@ class AnsibleJob(object):
host_vars = dict(
ansible_host=ip,
ansible_user=self.executor_server.default_username,
nodepool_az=node.get('az'),
nodepool_provider=node.get('provider'),
nodepool_region=node.get('region'))
nodepool=dict(
az=node.get('az'),
provider=node.get('provider'),
region=node.get('region')))
host_keys = []
for key in node.get('host_keys'):