diff --git a/evolinux-base/files/logs/logrotate.d/apache2-php b/evolinux-base/files/logs/logrotate.disabled/apache2-php similarity index 100% rename from evolinux-base/files/logs/logrotate.d/apache2-php rename to evolinux-base/files/logs/logrotate.disabled/apache2-php diff --git a/evolinux-base/files/logs/logrotate.d/bind.disabled b/evolinux-base/files/logs/logrotate.disabled/bind similarity index 100% rename from evolinux-base/files/logs/logrotate.d/bind.disabled rename to evolinux-base/files/logs/logrotate.disabled/bind diff --git a/evolinux-base/files/logs/logrotate.d/dhcp b/evolinux-base/files/logs/logrotate.disabled/dhcp similarity index 100% rename from evolinux-base/files/logs/logrotate.d/dhcp rename to evolinux-base/files/logs/logrotate.disabled/dhcp diff --git a/evolinux-base/files/logs/logrotate.d/freeradius b/evolinux-base/files/logs/logrotate.disabled/freeradius similarity index 100% rename from evolinux-base/files/logs/logrotate.d/freeradius rename to evolinux-base/files/logs/logrotate.disabled/freeradius diff --git a/evolinux-base/files/logs/logrotate.d/ftp.disabled b/evolinux-base/files/logs/logrotate.disabled/ftp similarity index 100% rename from evolinux-base/files/logs/logrotate.d/ftp.disabled rename to evolinux-base/files/logs/logrotate.disabled/ftp diff --git a/evolinux-base/files/logs/logrotate.d/ldap b/evolinux-base/files/logs/logrotate.disabled/ldap similarity index 100% rename from evolinux-base/files/logs/logrotate.d/ldap rename to evolinux-base/files/logs/logrotate.disabled/ldap diff --git a/evolinux-base/files/logs/logrotate.d/lighttpd.disabled b/evolinux-base/files/logs/logrotate.disabled/lighttpd similarity index 100% rename from evolinux-base/files/logs/logrotate.d/lighttpd.disabled rename to evolinux-base/files/logs/logrotate.disabled/lighttpd diff --git a/evolinux-base/files/logs/logrotate.d/lvm-common.disabled b/evolinux-base/files/logs/logrotate.disabled/lvm-common similarity index 100% rename from evolinux-base/files/logs/logrotate.d/lvm-common.disabled rename to evolinux-base/files/logs/logrotate.disabled/lvm-common diff --git a/evolinux-base/files/logs/logrotate.d/news.disabled b/evolinux-base/files/logs/logrotate.disabled/news similarity index 100% rename from evolinux-base/files/logs/logrotate.d/news.disabled rename to evolinux-base/files/logs/logrotate.disabled/news diff --git a/evolinux-base/files/logs/logrotate.d/ntp.disabled b/evolinux-base/files/logs/logrotate.disabled/ntp similarity index 100% rename from evolinux-base/files/logs/logrotate.d/ntp.disabled rename to evolinux-base/files/logs/logrotate.disabled/ntp diff --git a/evolinux-base/files/logs/logrotate.d/procmail b/evolinux-base/files/logs/logrotate.disabled/procmail similarity index 100% rename from evolinux-base/files/logs/logrotate.d/procmail rename to evolinux-base/files/logs/logrotate.disabled/procmail diff --git a/evolinux-base/files/logs/logrotate.d/samba b/evolinux-base/files/logs/logrotate.disabled/samba similarity index 100% rename from evolinux-base/files/logs/logrotate.d/samba rename to evolinux-base/files/logs/logrotate.disabled/samba diff --git a/evolinux-base/files/logs/logrotate.d/nginx b/nginx/files/logrotate_nginx similarity index 100% rename from evolinux-base/files/logs/logrotate.d/nginx rename to nginx/files/logrotate_nginx diff --git a/nginx/tasks/logrotate.yml b/nginx/tasks/logrotate.yml new file mode 100644 index 00000000..29e38978 --- /dev/null +++ b/nginx/tasks/logrotate.yml @@ -0,0 +1,6 @@ +--- +- name: logrotate configuration + copy: + src: logrotate_nginx + dest: /etc/logrotate.d/nginx + force: no diff --git a/nginx/tasks/main.yml b/nginx/tasks/main.yml index 5cc397c4..d8bae30e 100644 --- a/nginx/tasks/main.yml +++ b/nginx/tasks/main.yml @@ -5,7 +5,8 @@ state: installed notify: restart nginx tags: - - nginx + - nginx + - packages # TODO: find a way to override the main configuration # without touching the main file @@ -16,6 +17,8 @@ regexp: '^(\s*worker_connections)\s+.+;' line: ' worker_connections 1024;' insertafter: 'events \{' + tags: + - nginx - name: use epoll lineinfile: @@ -23,6 +26,8 @@ regexp: '^(\s*use)\s+.+;' line: ' use epoll;' insertafter: 'events \{' + tags: + - nginx - name: Install Nginx http configuration copy: @@ -32,7 +37,7 @@ # force: yes notify: reload nginx tags: - - nginx + - nginx # TODO: verify that those permissions are correct : # not too strict for private_ipaddr_whitelist @@ -49,7 +54,7 @@ force: no notify: reload nginx tags: - - nginx + - nginx - name: add IP addresses to private IP whitelist lineinfile: @@ -58,6 +63,8 @@ state: present with_items: "{{ nginx_private_ipaddr_whitelist_present }}" notify: reload nginx + tags: + - nginx - name: remove IP addresses from private IP whitelist lineinfile: @@ -66,6 +73,8 @@ state: absent with_items: "{{ nginx_private_ipaddr_whitelist_absent }}" notify: reload nginx + tags: + - nginx - name: Copy private_htpasswd copy: @@ -78,7 +87,7 @@ force: no notify: reload nginx tags: - - nginx + - nginx - name: add user:pwd to private htpasswd lineinfile: @@ -87,6 +96,8 @@ state: present with_items: "{{ nginx_private_htpasswd_present }}" notify: reload nginx + tags: + - nginx - name: remove user:pwd from private htpasswd lineinfile: @@ -95,6 +106,8 @@ state: absent with_items: "{{ nginx_private_htpasswd_absent }}" notify: reload nginx + tags: + - nginx - name: Verify that the service is enabled and started service: @@ -102,21 +115,26 @@ enabled: yes state: started tags: - - nginx + - nginx - name: Check if Munin is installed stat: path: /etc/munin/plugin-conf.d/munin-node register: stat_munin_node tags: - - munin + - nginx + - munin - include: munin_vhost.yml when: stat_munin_node.stat.exists tags: - - munin + - nginx + - munin - include: munin_graphs.yml when: stat_munin_node.stat.exists tags: - - munin + - nginx + - munin + +- include: logrotate.yml diff --git a/evolinux-base/files/logs/logrotate.d/postgresql b/postgresql/files/logrotate_postgresql similarity index 100% rename from evolinux-base/files/logs/logrotate.d/postgresql rename to postgresql/files/logrotate_postgresql diff --git a/postgresql/tasks/logrotate.yml b/postgresql/tasks/logrotate.yml new file mode 100644 index 00000000..e77347d8 --- /dev/null +++ b/postgresql/tasks/logrotate.yml @@ -0,0 +1,6 @@ +--- +- name: logrotate configuration + copy: + src: logrotate_postgresql + dest: /etc/logrotate.d/postgresql + force: no diff --git a/postgresql/tasks/main.yml b/postgresql/tasks/main.yml index e75f2607..c4d5eeac 100644 --- a/postgresql/tasks/main.yml +++ b/postgresql/tasks/main.yml @@ -4,3 +4,4 @@ - include: config.yml - include: nrpe.yml - include: munin.yml +- include: logrotate.yml diff --git a/evolinux-base/files/logs/logrotate.d/squid3.disabled b/squid/files/logrotate_squid3 similarity index 100% rename from evolinux-base/files/logs/logrotate.d/squid3.disabled rename to squid/files/logrotate_squid3 diff --git a/squid/tasks/logrotate.yml b/squid/tasks/logrotate.yml new file mode 100644 index 00000000..7f1066b4 --- /dev/null +++ b/squid/tasks/logrotate.yml @@ -0,0 +1,6 @@ +--- +- name: logrotate configuration + copy: + src: logrotate_squid3 + dest: /etc/logrotate.d/squid3 + force: no diff --git a/squid/tasks/main.yml b/squid/tasks/main.yml index 8edcd7a4..09a66da4 100644 --- a/squid/tasks/main.yml +++ b/squid/tasks/main.yml @@ -11,6 +11,11 @@ dest: /etc/squid3/squid.conf notify: restart squid +- name: logrotate configuration + copy: + src: logrotate_squid3 + dest: /etc/logrotate.d/squid3 + - name: evolix whitelist is present copy: src: whitelist-evolinux.conf @@ -26,6 +31,8 @@ force: no notify: restart squid +- include: logrotate.yml + - include: minifirewall.yml - include: log2mail.yml