diff options
author | Matt Clay <matt@mystile.com> | 2019-08-09 20:06:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-09 20:06:21 +0200 |
commit | cb68110296af1cd5ee62c032894a7e6608615576 (patch) | |
tree | dd19a42673e6a203954d653f9064ec3d7771ec07 /test/lib | |
parent | facts: fix double-counting of CPUs on POWER systems (#58360) (diff) | |
download | ansible-cb68110296af1cd5ee62c032894a7e6608615576.tar.xz ansible-cb68110296af1cd5ee62c032894a7e6608615576.zip |
Clean up ansible-test inventory templates. (#60321)
* Move ansible-test inventory templates.
* Remove obsolete inventoy.remote.template file.
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/ansible_test/_internal/executor.py | 7 | ||||
-rw-r--r-- | test/lib/ansible_test/config/inventory.networking.template | 42 | ||||
-rw-r--r-- | test/lib/ansible_test/config/inventory.winrm.template | 28 |
3 files changed, 75 insertions, 2 deletions
diff --git a/test/lib/ansible_test/_internal/executor.py b/test/lib/ansible_test/_internal/executor.py index f9caf59437..4657e3d681 100644 --- a/test/lib/ansible_test/_internal/executor.py +++ b/test/lib/ansible_test/_internal/executor.py @@ -61,6 +61,7 @@ from .util import ( cmd_quote, ANSIBLE_LIB_ROOT, ANSIBLE_TEST_DATA_ROOT, + ANSIBLE_TEST_CONFIG_ROOT, ) from .util_common import ( @@ -384,6 +385,7 @@ def command_network_integration(args): :type args: NetworkIntegrationConfig """ default_filename = 'test/integration/inventory.networking' + template_path = os.path.join(ANSIBLE_TEST_CONFIG_ROOT, os.path.basename(default_filename)) + '.template' if args.inventory: filename = os.path.join('test/integration', args.inventory) @@ -398,7 +400,7 @@ def command_network_integration(args): 'Inventory not found: %s\n' 'Use --inventory to specify the inventory path.\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)) @@ -562,9 +564,10 @@ def command_windows_integration(args): :type args: WindowsIntegrationConfig """ 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): - 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)) internal_targets = command_integration_filter(args, all_targets, init_callback=windows_init) diff --git a/test/lib/ansible_test/config/inventory.networking.template b/test/lib/ansible_test/config/inventory.networking.template new file mode 100644 index 0000000000..a15456841d --- /dev/null +++ b/test/lib/ansible_test/config/inventory.networking.template @@ -0,0 +1,42 @@ +# This is the configuration template for ansible-test network-integration tests. +# +# You do not need this template if you are: +# +# 1) Running integration tests without using ansible-test. +# 2) Using the `--platform` option to provision temporary network instances on EC2. +# +# If you do not want to use the automatically provisioned temporary network instances, +# fill in the @VAR placeholders below and save this file without the .template extension. +# +# NOTE: Automatic provisioning of network instances on EC2 requires an ansible-core-ci API key. + +[@OS] +@NAME ansible_connection="local" ansible_host=@HOST ansible_network_os="@OS" ansible_user="@USER" ansible_ssh_private_key_file="@KEY_FILE" + +[aci:vars] +aci_hostname=your-apic-1 +aci_username=admin +aci_password=your-apic-password +aci_validate_certs=no +aci_use_ssl=yes +aci_use_proxy=no + +[aci] +localhost ansible_ssh_host=127.0.0.1 ansible_connection=local + +[mso:vars] +mso_hostname=your-mso-1 +mso_username=admin +mso_password=your-mso-password +mso_validate_certs=no +mso_use_ssl=yes +mso_use_proxy=no + +[mso] +localhost ansible_ssh_host=127.0.0.1 ansible_connection=local + +### +# Example +# +# [vyos] +# vyos01.example.net ansible_connection=local ansible_network_os="vyos" ansible_user=admin ansible_ssh_pass=mypassword diff --git a/test/lib/ansible_test/config/inventory.winrm.template b/test/lib/ansible_test/config/inventory.winrm.template new file mode 100644 index 0000000000..34bbee2d4a --- /dev/null +++ b/test/lib/ansible_test/config/inventory.winrm.template @@ -0,0 +1,28 @@ +# This is the configuration template for ansible-test windows-integration tests. +# It can also be used with the legacy `make` based method of running tests. +# +# You do not need this template if you are: +# +# 1) Using the `--windows` option to provision temporary Windows instances on EC2. +# +# If you do not want to use the automatically provisioned temporary Windows instances, +# fill in the @VAR placeholders below and save this file without the .template extension. +# +# NOTE: Automatic provisioning of Windows instances on EC2 requires an ansible-core-ci API key. +# +# REMINDER: Standard ports for winrm are 5985 (HTTP) and 5986 (HTTPS). + +[windows] +@NAME ansible_host=@HOST ansible_user=@USER ansible_password=@PASSWORD ansible_port=@PORT + +[windows:vars] +ansible_connection=winrm +ansible_winrm_server_cert_validation=ignore + +# support winrm connection tests (temporary solution, does not support testing enable/disable of pipelining) +[winrm:children] +windows + +# support tests that target testhost +[testhost:children] +windows |