Allow ansible.cfg overrides (#27372)

If a cfg file exists for this this command then use it.
This allows versioned test configuration to override the built in
Ansible constants.
This commit is contained in:
John R Barker 2017-07-27 11:37:15 +01:00 committed by GitHub
parent 2eaf3571f3
commit 72bfb051c3
2 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,5 @@
# NOTE: This file is used by ansible-test to override specific Ansible constants
# This file is used by `ansible-test network-integration`
[defaults]
timeout = 60

View file

@ -21,10 +21,14 @@ def ansible_environment(args, color=True):
if not path.startswith(ansible_path + os.pathsep):
path = ansible_path + os.pathsep + path
ansible_config = '/dev/null'
if os.path.isfile('test/integration/%s.cfg' % args.command):
ansible_config = os.path.abspath('test/integration/%s.cfg' % args.command)
ansible = dict(
ANSIBLE_FORCE_COLOR='%s' % 'true' if args.color and color else 'false',
ANSIBLE_DEPRECATION_WARNINGS='false',
ANSIBLE_CONFIG='/dev/null',
ANSIBLE_CONFIG=ansible_config,
ANSIBLE_HOST_KEY_CHECKING='false',
PYTHONPATH=os.path.abspath('lib'),
PAGER='/bin/cat',