From 5bf82d117b04d84deff554839aa2e366ac1fd0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lecour?= Date: Sun, 22 Apr 2018 17:23:31 +0200 Subject: [PATCH] Don't copy empty files --- packweb-apache/files/log/access.log | 0 packweb-apache/files/log/error.log | 0 packweb-apache/tasks/main.yml | 18 ++++++++++++------ 3 files changed, 12 insertions(+), 6 deletions(-) delete mode 100644 packweb-apache/files/log/access.log delete mode 100644 packweb-apache/files/log/error.log diff --git a/packweb-apache/files/log/access.log b/packweb-apache/files/log/access.log deleted file mode 100644 index e69de29b..00000000 diff --git a/packweb-apache/files/log/error.log b/packweb-apache/files/log/error.log deleted file mode 100644 index e69de29b..00000000 diff --git a/packweb-apache/tasks/main.yml b/packweb-apache/tasks/main.yml index 0bac872e..b24c9ae6 100644 --- a/packweb-apache/tasks/main.yml +++ b/packweb-apache/tasks/main.yml @@ -27,15 +27,21 @@ - { path: awstats, mode: "0750", state: directory } - { path: www, mode: "0750", state: directory } -- name: Copy apache empty log files if missing - copy: - src: "log/{{ item }}" +- name: Apache log file (templates) are present + command: "touch /etc/skel/log/{{ item }}" + args: + creates: "/etc/skel/log/{{ item }}" + with_items: + - access.log + - error.log + +- name: Apache log file (templates) have the proper permissions + file: dest: "/etc/skel/log/{{ item }}" mode: "0644" - force: no with_items: - - access.log - - error.log + - access.log + - error.log - name: "Install userlogrotate (jessie)" copy: