Ansible is an apt replacement for all kinds of bash scripts. Typically, for most activities that require analysis, we follow a set pattern:
- Collect logs from running processes into files with a path we already know
- Copy the content from these log files periodically to a secure storage locally or accessible remotely over SSH or a network file share
- Once copied successfully, rotate the logs
Since there is a bit of network activity involved, our bash scripts are usually written to be fault tolerant with regard to network connections and become complex very soon. Ansible playbooks can be used to do all of that while being simple to read for everyone.