ios_facts: Report space of file systems (#41850)

* ios_facts: Report file system space

Parse total and free space from dir output. For this, add a hash
filesystems_info containing the keys spacetotal_kb and spacefree_kb.

* ios_facts: Add unit test for file system space reporting

* ios_facts: Add integration test for file system space reporting
This commit is contained in:
Paul Neumann 2018-07-09 15:15:31 +02:00 committed by Nathaniel Case
parent dbb58b34c3
commit dfb2b3fdd5
7 changed files with 62 additions and 0 deletions

View file

@ -28,4 +28,8 @@
- "result.ansible_facts.ansible_net_memfree_mb > 1"
- "result.ansible_facts.ansible_net_memtotal_mb > 1"
- assert:
that: "{{ item.value.spacetotal_kb }} > {{ item.value.spacefree_kb }}"
loop: "{{ lookup('dict', result.ansible_facts.ansible_net_filesystems_info, wantlist=True) }}"
- debug: msg="END cli/all_facts.yaml on connection={{ ansible_connection }}"

View file

@ -28,4 +28,8 @@
# ... and not present
- "result.ansible_facts.ansible_net_config is not defined" # config
- assert:
that: "{{ item.value.spacetotal_kb }} > {{ item.value.spacefree_kb }}"
loop: "{{ lookup('dict', result.ansible_facts.ansible_net_filesystems_info, wantlist=True) }}"
- debug: msg="END cli/default.yaml on connection={{ ansible_connection }}"

View file

@ -26,5 +26,6 @@
- "result.ansible_facts.ansible_net_interfaces | length > 1" # more than one interface returned
# ... and not present
- "result.ansible_facts.ansible_net_filesystems is not defined"
- "result.ansible_facts.ansible_net_filesystems_info is not defined"
- debug: msg="END cli/not_hardware_facts.yaml on connection={{ ansible_connection }}"