summaryrefslogtreecommitdiff
path: root/test/integration/targets/inventory_aws_rds/runme.sh
blob: d759349e769b65d3956fc451cc89223ec71620ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash

set -eux

# ensure test config is empty
ansible-playbook playbooks/empty_inventory_config.yml "$@"

export ANSIBLE_INVENTORY_ENABLED=aws_rds

# test with default inventory file
ansible-playbook playbooks/test_invalid_aws_rds_inventory_config.yml "$@"

export ANSIBLE_INVENTORY=test.aws_rds.yml

# test empty inventory config
ansible-playbook playbooks/test_invalid_aws_rds_inventory_config.yml "$@"

# generate inventory config and test using it
ansible-playbook playbooks/create_inventory_config.yml "$@"
ansible-playbook playbooks/test_populating_inventory.yml "$@"

# generate inventory config with caching and test using it
ansible-playbook playbooks/create_inventory_config.yml -e "template='inventory_with_cache.j2'" "$@"
ansible-playbook playbooks/populate_cache.yml "$@"
ansible-playbook playbooks/test_inventory_cache.yml "$@"

# remove inventory cache
rm -r aws_rds_cache_dir/

# generate inventory config with constructed features and test using it
ansible-playbook playbooks/create_inventory_config.yml -e "template='inventory_with_constructed.j2'" "$@"
ansible-playbook playbooks/test_populating_inventory_with_constructed.yml "$@"

# cleanup inventory config
ansible-playbook playbooks/empty_inventory_config.yml "$@"