blob: 608c0c2f8317b90dadd61d355540c02b91f34b63 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
- name: Check if {{ logs_path }} exists
stat:
path: "{{ logs_path }}"
register: logs_path_info
- name: Prepare logs archive {{ log_archive_file_name }}
become: yes
shell:
cmd: |
/usr/bin/tar -czf {{ log_archive_file_name }} {{ logs_path }}
when: logs_path_info.stat.exists
- name: Set {{ log_archive_file_name }} ownership
become: yes
file:
path: "{{ log_archive_file_name }}"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
mode: 0775
when: logs_path_info.stat.exists
|