system-config/testinfra/conftest.py
Monty Taylor 83ced7f6e6 Split inventory into multiple dirs and move hostvars
Make inventory/service for service-specific things, including the
groups.yaml group definitions, and inventory/base for hostvars
related to the base system, including the list of hosts.

Move the exisitng host_vars into inventory/service, since most of
them are likely service-specific. Move group_vars/all.yaml into
base/group_vars as almost all of it is related to base things,
with the execption of the gerrit public key.

A followup patch will move host-specific values into equivilent
files in inventory/base.

This should let us override hostvars in gate jobs. It should also
allow us to do better file matchers - and to be able to organize
our playbooks move if we want to.

Depends-On: https://review.opendev.org/731583
Change-Id: Iddf57b5be47c2e9de16b83a1bc83bee25db995cf
2020-06-04 07:44:36 -05:00

21 lines
507 B
Python

import os
import pytest
import yaml
@pytest.fixture
def zuul_data():
data = {}
with open('/home/zuul/src/opendev.org/opendev/system-config/inventory/base/gate-hosts.yaml') as f:
inventory = yaml.load(f)
data['inventory'] = inventory
zuul_extra_data_file = os.environ.get('TESTINFRA_EXTRA_DATA')
if os.path.exists(zuul_extra_data_file):
with open(zuul_extra_data_file, 'r') as f:
extra = yaml.load(f)
data['extra'] = extra
return data