mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
06f5e49dfb
* Check get_option method works with inventory plugins This use case is already tested by some cloud inventoty plugin but these tests are slow and aren't always executed, hence this new quick test. * AnsiblePlugin: Fix typo in docstring
16 lines
705 B
Bash
Executable file
16 lines
705 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -o errexit -o nounset -o xtrace
|
|
|
|
export ANSIBLE_INVENTORY_PLUGINS=./
|
|
export ANSIBLE_INVENTORY_ENABLED=test_inventory
|
|
|
|
# check default values
|
|
ansible-inventory --list -i ./config_without_parameter.yml --export | \
|
|
env python -c "import json, sys; inv = json.loads(sys.stdin.read()); \
|
|
assert set(inv['_meta']['hostvars']['test_host']['departments']) == set(['seine-et-marne', 'haute-garonne'])"
|
|
|
|
# check values
|
|
ansible-inventory --list -i ./config_with_parameter.yml --export | \
|
|
env python -c "import json, sys; inv = json.loads(sys.stdin.read()); \
|
|
assert set(inv['_meta']['hostvars']['test_host']['departments']) == set(['paris'])"
|