This PR implements the requested behavior in #122 - to split files up when they're too large. Due to the limitations in Ansible 2.9 and earlier, I've reworked a portion of the playbook into a python script.
The new script handles the entire tarball generation process, including checking file size and ensuring the resulting tarball is below the requested size limit. The script will split up the CSVs when either any single file or the sum total size exceeds the requested limit. When it splits files, the script preserves the CSV header and ensures each split file contains the header from the original CSV.
Test case: Original behavior is preserved when there is nothing to split
This PR implements the requested behavior in #122 - to split files up when they're too large. Due to the limitations in Ansible 2.9 and earlier, I've reworked a portion of the playbook into a python script.
The new script handles the entire tarball generation process, including checking file size and ensuring the resulting tarball is below the requested size limit. The script will split up the CSVs when either any single file or the sum total size exceeds the requested limit. When it splits files, the script preserves the CSV header and ensures each split file contains the header from the original CSV.
Test case: Original behavior is preserved when there is nothing to split
Test case: running the script on a file that needs splitting (
-vv
flags added to show script operations)