mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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:
parent
2eaf3571f3
commit
72bfb051c3
2 changed files with 10 additions and 1 deletions
5
test/integration/network-integration.cfg
Normal file
5
test/integration/network-integration.cfg
Normal 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
|
|
@ -21,10 +21,14 @@ def ansible_environment(args, color=True):
|
||||||
if not path.startswith(ansible_path + os.pathsep):
|
if not path.startswith(ansible_path + os.pathsep):
|
||||||
path = ansible_path + os.pathsep + path
|
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 = dict(
|
||||||
ANSIBLE_FORCE_COLOR='%s' % 'true' if args.color and color else 'false',
|
ANSIBLE_FORCE_COLOR='%s' % 'true' if args.color and color else 'false',
|
||||||
ANSIBLE_DEPRECATION_WARNINGS='false',
|
ANSIBLE_DEPRECATION_WARNINGS='false',
|
||||||
ANSIBLE_CONFIG='/dev/null',
|
ANSIBLE_CONFIG=ansible_config,
|
||||||
ANSIBLE_HOST_KEY_CHECKING='false',
|
ANSIBLE_HOST_KEY_CHECKING='false',
|
||||||
PYTHONPATH=os.path.abspath('lib'),
|
PYTHONPATH=os.path.abspath('lib'),
|
||||||
PAGER='/bin/cat',
|
PAGER='/bin/cat',
|
||||||
|
|
Loading…
Reference in a new issue