From ddf91a3d6f6e18fea2949acc7fb5d8dcba0368b3 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 20 Feb 2014 12:51:13 -0500 Subject: [PATCH] Add a partial test of variable blending to the test infrastructure. --- tests_new/integration/integration_config.yml | 5 ++++ tests_new/integration/inventory | 25 ++++++++++++++++++++ tests_new/integration/non_destructive.yml | 10 ++++++++ 3 files changed, 40 insertions(+) diff --git a/tests_new/integration/integration_config.yml b/tests_new/integration/integration_config.yml index 060942d2aa6..4c2fb2a0a50 100644 --- a/tests_new/integration/integration_config.yml +++ b/tests_new/integration/integration_config.yml @@ -2,3 +2,8 @@ output_dir: ~/ansible_testing non_root_test_user: ansible pip_test_package: epdb + +# variables used in precedence tests, here passed to -e +etest: 'from -e' + + diff --git a/tests_new/integration/inventory b/tests_new/integration/inventory index 0cadcbeb92c..65fc130a23f 100644 --- a/tests_new/integration/inventory +++ b/tests_new/integration/inventory @@ -1,2 +1,27 @@ [local] testhost ansible_ssh_host=127.0.0.1 ansible_connection=local +testhost2 ansible_ssh_host=127.0.0.1 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/tests_new/integration/non_destructive.yml b/tests_new/integration/non_destructive.yml index 33a719537e5..181030b1e6f 100644 --- a/tests_new/integration/non_destructive.yml +++ b/tests_new/integration/non_destructive.yml @@ -1,4 +1,13 @@ - hosts: testhost + + # these variables are defined here for variable blending tests only. + # in general, define test variables in the role/rolenamevars/main.yml + + vars_files: + - vars_file.yml + vars: + vars_var: 123 + gather_facts: True roles: - { role: test_copy, tags: test_copy } @@ -11,4 +20,5 @@ - { role: test_git, tags: test_git } - { role: test_hg, tags: test_hg } - { role: test_changed_when, tags: test_changed_when } + - { role: test_var_blending, tags: test_var_blending }