Extract logrotate configurations in roles

This commit is contained in:
Jérémy Lecour 2017-01-03 16:50:46 +01:00 committed by Jérémy Lecour
parent 130e1f2b0e
commit 91c8fad950
21 changed files with 52 additions and 8 deletions

View File

@ -0,0 +1,6 @@
---
- name: logrotate configuration
copy:
src: logrotate_nginx
dest: /etc/logrotate.d/nginx
force: no

View File

@ -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

View File

@ -0,0 +1,6 @@
---
- name: logrotate configuration
copy:
src: logrotate_postgresql
dest: /etc/logrotate.d/postgresql
force: no

View File

@ -4,3 +4,4 @@
- include: config.yml
- include: nrpe.yml
- include: munin.yml
- include: logrotate.yml

View File

@ -0,0 +1,6 @@
---
- name: logrotate configuration
copy:
src: logrotate_squid3
dest: /etc/logrotate.d/squid3
force: no

View File

@ -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