Clean up ansible-test inventory templates. (#60321)

* Move ansible-test inventory templates.
* Remove obsolete inventoy.remote.template file.
This commit is contained in:
Matt Clay 2019-08-09 11:06:21 -07:00 committed by GitHub
parent 93d9d64038
commit cb68110296
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 12 deletions

1
.gitignore vendored
View file

@ -88,7 +88,6 @@ packaging/release/ansible_release
/test/results/logs/*.log /test/results/logs/*.log
/test/results/data/*.json /test/results/data/*.json
/test/integration/cloud-config-aws.yml /test/integration/cloud-config-aws.yml
/test/integration/inventory.remote
/test/integration/inventory.networking /test/integration/inventory.networking
/test/integration/inventory.winrm /test/integration/inventory.winrm
/test/integration/cloud-config-aws.yml /test/integration/cloud-config-aws.yml

View file

@ -1,9 +0,0 @@
[posix]
remote
[posix:vars]
ansible_connection=ssh
ansible_host=@ansible_host
ansible_port=@ansible_port
ansible_user=@ansible_user
ansible_python_interpreter=/usr/local/bin/python2

View file

@ -61,6 +61,7 @@ from .util import (
cmd_quote, cmd_quote,
ANSIBLE_LIB_ROOT, ANSIBLE_LIB_ROOT,
ANSIBLE_TEST_DATA_ROOT, ANSIBLE_TEST_DATA_ROOT,
ANSIBLE_TEST_CONFIG_ROOT,
) )
from .util_common import ( from .util_common import (
@ -384,6 +385,7 @@ def command_network_integration(args):
:type args: NetworkIntegrationConfig :type args: NetworkIntegrationConfig
""" """
default_filename = 'test/integration/inventory.networking' default_filename = 'test/integration/inventory.networking'
template_path = os.path.join(ANSIBLE_TEST_CONFIG_ROOT, os.path.basename(default_filename)) + '.template'
if args.inventory: if args.inventory:
filename = os.path.join('test/integration', args.inventory) filename = os.path.join('test/integration', args.inventory)
@ -398,7 +400,7 @@ def command_network_integration(args):
'Inventory not found: %s\n' 'Inventory not found: %s\n'
'Use --inventory to specify the inventory path.\n' 'Use --inventory to specify the inventory path.\n'
'Use --platform to provision resources and generate an inventory file.\n' 'Use --platform to provision resources and generate an inventory file.\n'
'See also inventory template: %s.template' % (filename, default_filename) 'See also inventory template: %s' % (filename, template_path)
) )
all_targets = tuple(walk_network_integration_targets(include_hidden=True)) all_targets = tuple(walk_network_integration_targets(include_hidden=True))
@ -562,9 +564,10 @@ def command_windows_integration(args):
:type args: WindowsIntegrationConfig :type args: WindowsIntegrationConfig
""" """
filename = 'test/integration/inventory.winrm' filename = 'test/integration/inventory.winrm'
template_path = os.path.join(ANSIBLE_TEST_CONFIG_ROOT, os.path.basename(filename)) + '.template'
if not args.explain and not args.windows and not os.path.isfile(filename): if not args.explain and not args.windows and not os.path.isfile(filename):
raise ApplicationError('Use the --windows option or provide an inventory file (see %s.template).' % filename) raise ApplicationError('Use the --windows option or provide an inventory file (see %s).' % template_path)
all_targets = tuple(walk_windows_integration_targets(include_hidden=True)) all_targets = tuple(walk_windows_integration_targets(include_hidden=True))
internal_targets = command_integration_filter(args, all_targets, init_callback=windows_init) internal_targets = command_integration_filter(args, all_targets, init_callback=windows_init)