collect-logs: broader txt.gz rename conditions

In addition to known text file extensions, also rename files without
extension in the /var/log and /etc directories.

Change-Id: Ia9898816831392951cd927b7661d4d8fdcb4d007
This commit is contained in:
Attila Darazs 2017-01-24 11:20:17 +01:00
parent e168524fed
commit 28797c37c5
1 changed files with 4 additions and 2 deletions

View File

@ -28,8 +28,10 @@
- name: Rename text based files to end with txt.gz extension
shell: >
find {{ artcl_collect_dir }} -type f |
awk '/\.(conf|ini|json|sh|log|yaml|yml)\.gz$/ {
renamed=$0; sub(/\.gz$/, ".txt.gz", renamed); system("mv " $0 " " renamed) }';
awk 'function rename(orig)
{ new=orig; sub(/\.gz$/, ".txt.gz", new); system("mv " orig " " new) }
/\.(conf|ini|json|sh|log|yaml|yml)\.gz$/ { rename($0) }
/(\/var\/log\/|\/etc\/)[^ \/\.]+\.gz$/ { rename($0) }';
when: artcl_txt_rename|bool
- name: upload to the artifact server using pubkey auth