The final version appears as:
---
- hosts: "{{ host | default('localhost') }}"
vars:
- loglist:
- /var/log/wtmp
- /var/log/apache2/access.log
- /var/log/apache2/error.log
tasks:
- name: erase old downloaded .deb archives
command: apt autoclean
- name: get log size info
stat: path={{ item }}
with_items: loglist
register: logsize
- name: cleaning up logs that exceed 5Mb
debug: "msg='{{ item.item }}: {{ item.stat.size }}'"
with_items: logsize.results
when: item.stat.size > 5*(1024**2)
But the output of Ansible is way too huge.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/873314b0-5d7e-42d6-be46-a57e43babecd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.