Debian Codegraph @

test/integration/targets/ansible-inventory/tasks/json_output.yml

raw symbols SCIP
1 - block:
2 - name: check baseline
3 command: ansible-inventory -i '{{ role_path }}/files/valid_sample.yml' --list
4 register: limited
5
6 - name: ensure non empty host list
7 assert:
8 that:
9 - "'something' in inv['_meta']['hostvars']"
10
11 - name: check that limit removes host
12 command: ansible-inventory -i '{{ role_path }}/files/valid_sample.yml' --limit '!something' --list
13 register: limited
14
15 - name: ensure empty host list
16 assert:
17 that:
18 - "'something' not in inv['_meta']['hostvars']"
19
20 - name: check dupes
21 command: ansible-inventory -i '{{ role_path }}/files/complex.ini' --list
22 register: limited
23
24 - name: ensure host only appears on directly assigned
25 assert:
26 that:
27 - "'hosts' not in inv['parent_1']"
28 - "'hosts' not in inv['parent_2']"
29 - "'hosts' in inv['parent_3']"
30 - "'test1' in inv['test_group1']['hosts']"
31 vars:
32 inv: '{{limited.stdout|from_json(profile="inventory_legacy") }}'
33 delegate_to: localhost