diff --git a/test/integration/inventory b/test/integration/inventory index 55cd4bc113..898767410d 100644 --- a/test/integration/inventory +++ b/test/integration/inventory @@ -1,52 +1,8 @@ -[local] -testhost ansible_ssh_host=127.0.0.1 ansible_connection=local host_var_role_name=role3 -testhost2 ansible_ssh_host=127.0.0.1 ansible_connection=local host_var_role_name=role2 -# For testing delegate_to -testhost3 ansible_ssh_host=127.0.0.3 -testhost4 ansible_ssh_host=127.0.0.4 -# For testing fact gathering -facthost[0:25] ansible_host=127.0.0.1 ansible_connection=local +# Do not put test specific entries in this inventory file. +# For script based test targets (using runme.sh) put the inventory file in the test's directory instead. -[binary_modules] -testhost_binary_modules ansible_host=127.0.0.1 ansible_connection=local - -[local_group] -kube-pippin.knf.local - -# the following inline declarations are accompanied -# by (preferred) group_vars/ and host_vars/ variables -# and are used in testing of variable precedence - -[inven_overridehosts] -invenoverride ansible_ssh_host=127.0.0.1 ansible_connection=local - -[all:vars] -extra_var_override=FROM_INVENTORY -inven_var=inventory_var -unicode_host_var=CaféEñyei - -[inven_overridehosts:vars] -foo=foo -var_dir=vars - -[arbitrary_parent:children] -local - -[local:vars] -parent_var=6000 -groups_tree_var=5000 - -[arbitrary_parent:vars] -groups_tree_var=4000 -overridden_in_parent=1000 - -[arbitrary_grandparent:children] -arbitrary_parent - -[arbitrary_grandparent:vars] -groups_tree_var=3000 -grandparent_var=2000 -overridden_in_parent=2000 +[testgroup] +testhost ansible_connection=local [aci:vars] aci_hostname=your-apic-1 @@ -58,9 +14,3 @@ aci_use_proxy=no [aci] localhost ansible_ssh_host=127.0.0.1 ansible_connection=local - -[amazon] -localhost ansible_ssh_host=127.0.0.1 ansible_connection=local - -[azure] -localhost ansible_ssh_host=127.0.0.1 ansible_connection=local diff --git a/test/integration/inventory.winrm.template b/test/integration/inventory.winrm.template index 954deca7b9..34bbee2d4a 100644 --- a/test/integration/inventory.winrm.template +++ b/test/integration/inventory.winrm.template @@ -23,6 +23,6 @@ ansible_winrm_server_cert_validation=ignore [winrm:children] windows -# support winrm binary module tests (temporary solution) -[testhost_binary_modules:children] +# support tests that target testhost +[testhost:children] windows diff --git a/test/integration/targets/binary_modules/download_binary_modules.yml b/test/integration/targets/binary_modules/download_binary_modules.yml index 456ddb4a79..52ec83333a 100644 --- a/test/integration/targets/binary_modules/download_binary_modules.yml +++ b/test/integration/targets/binary_modules/download_binary_modules.yml @@ -1,4 +1,4 @@ -- hosts: testhost_binary_modules +- hosts: testhost tasks: - debug: var=ansible_system diff --git a/test/integration/targets/binary_modules/test_binary_modules.yml b/test/integration/targets/binary_modules/test_binary_modules.yml index e02271bea2..bdf2a06119 100644 --- a/test/integration/targets/binary_modules/test_binary_modules.yml +++ b/test/integration/targets/binary_modules/test_binary_modules.yml @@ -1,4 +1,4 @@ -- hosts: testhost_binary_modules +- hosts: testhost roles: - role: test_binary_modules tags: diff --git a/test/integration/targets/delegate_to/aliases b/test/integration/targets/delegate_to/aliases index b59832142f..1bf9c0dc22 100644 --- a/test/integration/targets/delegate_to/aliases +++ b/test/integration/targets/delegate_to/aliases @@ -1 +1,2 @@ shippable/posix/group3 +needs/ssh diff --git a/test/integration/targets/delegate_to/inventory b/test/integration/targets/delegate_to/inventory new file mode 100644 index 0000000000..dfd3a95372 --- /dev/null +++ b/test/integration/targets/delegate_to/inventory @@ -0,0 +1,5 @@ +[local] +testhost ansible_connection=local +testhost2 ansible_connection=local +testhost3 ansible_ssh_host=127.0.0.3 +testhost4 ansible_ssh_host=127.0.0.4 diff --git a/test/integration/targets/delegate_to/runme.sh b/test/integration/targets/delegate_to/runme.sh index c7c64683c1..26d48e2996 100755 --- a/test/integration/targets/delegate_to/runme.sh +++ b/test/integration/targets/delegate_to/runme.sh @@ -3,7 +3,7 @@ set -eux ANSIBLE_SSH_ARGS='-C -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null' \ - ANSIBLE_HOST_KEY_CHECKING=false ansible-playbook test_delegate_to.yml -i ../../inventory -v "$@" + ANSIBLE_HOST_KEY_CHECKING=false ansible-playbook test_delegate_to.yml -i inventory -v "$@" ansible-playbook test_loop_control.yml -v "$@" diff --git a/test/integration/targets/gathering_facts/inventory b/test/integration/targets/gathering_facts/inventory new file mode 100644 index 0000000000..8c6c24a379 --- /dev/null +++ b/test/integration/targets/gathering_facts/inventory @@ -0,0 +1,2 @@ +[local] +facthost[0:25] ansible_connection=local diff --git a/test/integration/targets/gathering_facts/runme.sh b/test/integration/targets/gathering_facts/runme.sh index 4baf8379e3..db23764157 100755 --- a/test/integration/targets/gathering_facts/runme.sh +++ b/test/integration/targets/gathering_facts/runme.sh @@ -2,8 +2,8 @@ set -eux -# ANSIBLE_CACHE_PLUGINS=cache_plugins/ ANSIBLE_CACHE_PLUGIN=none ansible-playbook test_gathering_facts.yml -i ../../inventory -v "$@" -ansible-playbook test_gathering_facts.yml -i ../../inventory -v "$@" -#ANSIBLE_CACHE_PLUGIN=base ansible-playbook test_gathering_facts.yml -i ../../inventory -v "$@" +# ANSIBLE_CACHE_PLUGINS=cache_plugins/ ANSIBLE_CACHE_PLUGIN=none ansible-playbook test_gathering_facts.yml -i inventory -v "$@" +ansible-playbook test_gathering_facts.yml -i inventory -v "$@" +# ANSIBLE_CACHE_PLUGIN=base ansible-playbook test_gathering_facts.yml -i inventory -v "$@" -ANSIBLE_GATHERING=smart ansible-playbook test_run_once.yml -i ../../inventory -v "$@" +ANSIBLE_GATHERING=smart ansible-playbook test_run_once.yml -i inventory -v "$@" diff --git a/test/integration/targets/unicode/inventory b/test/integration/targets/unicode/inventory new file mode 100644 index 0000000000..256e8c0ddf --- /dev/null +++ b/test/integration/targets/unicode/inventory @@ -0,0 +1,5 @@ +[local] +testhost ansible_connection=local + +[all:vars] +unicode_host_var=CaféEñyei diff --git a/test/integration/targets/unicode/runme.sh b/test/integration/targets/unicode/runme.sh index 0182093f41..8757530f96 100755 --- a/test/integration/targets/unicode/runme.sh +++ b/test/integration/targets/unicode/runme.sh @@ -2,6 +2,6 @@ set -eux -ansible-playbook unicode.yml -i ../../inventory -v -e 'extra_var=café' "$@" +ansible-playbook unicode.yml -i inventory -v -e 'extra_var=café' "$@" # Test the start-at-task flag #9571 -ansible-playbook unicode.yml -i ../../inventory -v --start-at-task '*¶' -e 'start_at_task=True' "$@" +ansible-playbook unicode.yml -i inventory -v --start-at-task '*¶' -e 'start_at_task=True' "$@" diff --git a/test/integration/targets/var_blending/inventory b/test/integration/targets/var_blending/inventory new file mode 100644 index 0000000000..542f8ecab3 --- /dev/null +++ b/test/integration/targets/var_blending/inventory @@ -0,0 +1,26 @@ +[local] +testhost ansible_connection=local +testhost2 ansible_connection=local + +# the following inline declarations are accompanied +# by (preferred) group_vars/ and host_vars/ variables +# and are used in testing of variable precedence + +[arbitrary_parent:children] +local + +[local:vars] +parent_var=6000 +groups_tree_var=5000 + +[arbitrary_parent:vars] +groups_tree_var=4000 +overridden_in_parent=1000 + +[arbitrary_grandparent:children] +arbitrary_parent + +[arbitrary_grandparent:vars] +groups_tree_var=3000 +grandparent_var=2000 +overridden_in_parent=2000 diff --git a/test/integration/targets/var_blending/runme.sh b/test/integration/targets/var_blending/runme.sh index 8f09e3e919..24e523ced5 100755 --- a/test/integration/targets/var_blending/runme.sh +++ b/test/integration/targets/var_blending/runme.sh @@ -2,4 +2,4 @@ set -eux -ansible-playbook test_var_blending.yml -i ../../inventory -e @integration_config.yml -v "$@" +ansible-playbook test_var_blending.yml -i inventory -e @integration_config.yml -v "$@" diff --git a/test/integration/targets/var_precedence/inventory b/test/integration/targets/var_precedence/inventory new file mode 100644 index 0000000000..3fcf28e72c --- /dev/null +++ b/test/integration/targets/var_precedence/inventory @@ -0,0 +1,13 @@ +[local] +testhost ansible_connection=local + +[all:vars] +extra_var_override=FROM_INVENTORY +inven_var=inventory_var + +[inven_overridehosts] +invenoverride ansible_connection=local + +[inven_overridehosts:vars] +foo=foo +var_dir=vars diff --git a/test/integration/targets/var_precedence/runme.sh b/test/integration/targets/var_precedence/runme.sh index c6dc3e9971..0f0811c3e9 100755 --- a/test/integration/targets/var_precedence/runme.sh +++ b/test/integration/targets/var_precedence/runme.sh @@ -2,7 +2,7 @@ set -eux -ansible-playbook test_var_precedence.yml -i ../../inventory -v "$@" \ +ansible-playbook test_var_precedence.yml -i inventory -v "$@" \ -e 'extra_var=extra_var' \ -e 'extra_var_override=extra_var_override' diff --git a/test/runner/lib/cloud/aws.py b/test/runner/lib/cloud/aws.py index 77937ccb6f..9844347171 100644 --- a/test/runner/lib/cloud/aws.py +++ b/test/runner/lib/cloud/aws.py @@ -103,10 +103,3 @@ class AwsCloudEnvironment(CloudEnvironment): if not tries and self.managed: display.notice('If %s failed due to permissions, the IAM test policy may need to be updated. ' 'For help, consult @mattclay or @gundalow on GitHub or #ansible-devel on IRC.' % target.name) - - @property - def inventory_hosts(self): - """ - :rtype: str | None - """ - return 'amazon' diff --git a/test/runner/lib/cloud/azure.py b/test/runner/lib/cloud/azure.py index a28f3e4a60..03297fc9d7 100644 --- a/test/runner/lib/cloud/azure.py +++ b/test/runner/lib/cloud/azure.py @@ -161,13 +161,6 @@ class AzureCloudEnvironment(CloudEnvironment): display.notice('If %s failed due to permissions, the test policy may need to be updated. ' 'For help, consult @mattclay or @gundalow on GitHub or #ansible-devel on IRC.' % target.name) - @property - def inventory_hosts(self): - """ - :rtype: str | None - """ - return 'azure' - def get_config(config_path): """