diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
commit | 8a754e0858d922e955e71b253c139e071ecec432 (patch) | |
tree | 527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/inventory_constructed/runme.sh | |
parent | Initial commit. (diff) | |
download | ansible-core-upstream.tar.xz ansible-core-upstream.zip |
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/targets/inventory_constructed/runme.sh')
-rwxr-xr-x | test/integration/targets/inventory_constructed/runme.sh | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/test/integration/targets/inventory_constructed/runme.sh b/test/integration/targets/inventory_constructed/runme.sh new file mode 100755 index 0000000..91bbd66 --- /dev/null +++ b/test/integration/targets/inventory_constructed/runme.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +set -eux + +ansible-inventory -i static_inventory.yml -i constructed.yml --graph | tee out.txt + +grep '@_hostvalue1' out.txt +grep '@_item0' out.txt +grep '@_key0_value0' out.txt +grep '@prefix_hostvalue1' out.txt +grep '@prefix_item0' out.txt +grep '@prefix_key0_value0' out.txt +grep '@separatorhostvalue1' out.txt +grep '@separatoritem0' out.txt +grep '@separatorkey0separatorvalue0' out.txt + +ansible-inventory -i static_inventory.yml -i no_leading_separator_constructed.yml --graph | tee out.txt + +grep '@hostvalue1' out.txt +grep '@item0' out.txt +grep '@key0_value0' out.txt +grep '@key0separatorvalue0' out.txt +grep '@prefix_hostvalue1' out.txt +grep '@prefix_item0' out.txt +grep '@prefix_key0_value0' out.txt + +# keyed group with default value for key's value empty (dict) +ansible-inventory -i tag_inventory.yml -i keyed_group_default_value.yml --graph | tee out.txt + +grep '@tag_name_host0' out.txt +grep '@tag_environment_test' out.txt +grep '@tag_status_running' out.txt + +# keyed group with default value for key's value empty (list) +ansible-inventory -i tag_inventory.yml -i keyed_group_list_default_value.yml --graph | tee out.txt + +grep '@host_db' out.txt +grep '@host_web' out.txt +grep '@host_storage' out.txt + +# keyed group with default value for key's value empty (str) +ansible-inventory -i tag_inventory.yml -i keyed_group_str_default_value.yml --graph | tee out.txt + +grep '@host_fedora' out.txt + + +# keyed group with 'trailing_separator' set to 'False' for key's value empty +ansible-inventory -i tag_inventory.yml -i keyed_group_trailing_separator.yml --graph | tee out.txt + +grep '@tag_name_host0' out.txt +grep '@tag_environment_test' out.txt +grep '@tag_status' out.txt + + +# test using use_vars_plugins +ansible-inventory -i invs/1/one.yml -i invs/2/constructed.yml --graph | tee out.txt + +grep '@c_lola' out.txt +grep '@c_group4testing' out.txt |