Debian Codegraph @

test/integration/targets/cache-plugins/test_inventory_cache.yml

raw
1 - hosts: localhost
2 gather_facts: no
3 vars:
4 cache_options_message: "Cache options were provided but may not reconcile correctly unless set via set_options"
5 no_parse_message: "No inventory was parsed, only implicit localhost is available"
6 expected_host_name: host1
7 base_environment:
8 ANSIBLE_FORCE_COLOR: 0
9 legacy_cache:
10 DUMMY_CACHE_SKIP_SUPER: 1
11 tasks:
12 - name: legacy-style cache plugin should cause a warning
13 command: ansible-inventory -i test.inventoryconfig.yml --graph --playbook-dir .
14 register: result
15 environment: "{{ base_environment | combine(legacy_cache) }}"
16
17 - name: test warning output (no inventory)
18 assert:
19 that:
20 - result.stderr is contains cache_options_message
21 - result.stderr is contains no_parse_message
22 - result.stdout is not contains expected_host_name
23
24 - name: cache plugin updated to use config manager should work
25 command: ansible-inventory -i test.inventoryconfig.yml --graph --playbook-dir .
26 register: result
27 environment: "{{ base_environment }}"
28
29 - name: test warning output (inventory parse success)
30 assert:
31 that:
32 - result.stderr is not contains cache_options_message
33 - result.stderr is not contains no_parse_message
34 - result.stdout is contains expected_host_name