forked from evolix/ansible-roles
Extract logrotate configurations in roles
This commit is contained in:
parent
130e1f2b0e
commit
91c8fad950
6
nginx/tasks/logrotate.yml
Normal file
6
nginx/tasks/logrotate.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
- name: logrotate configuration
|
||||||
|
copy:
|
||||||
|
src: logrotate_nginx
|
||||||
|
dest: /etc/logrotate.d/nginx
|
||||||
|
force: no
|
|
@ -5,7 +5,8 @@
|
||||||
state: installed
|
state: installed
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
tags:
|
tags:
|
||||||
- nginx
|
- nginx
|
||||||
|
- packages
|
||||||
|
|
||||||
# TODO: find a way to override the main configuration
|
# TODO: find a way to override the main configuration
|
||||||
# without touching the main file
|
# without touching the main file
|
||||||
|
@ -16,6 +17,8 @@
|
||||||
regexp: '^(\s*worker_connections)\s+.+;'
|
regexp: '^(\s*worker_connections)\s+.+;'
|
||||||
line: ' worker_connections 1024;'
|
line: ' worker_connections 1024;'
|
||||||
insertafter: 'events \{'
|
insertafter: 'events \{'
|
||||||
|
tags:
|
||||||
|
- nginx
|
||||||
|
|
||||||
- name: use epoll
|
- name: use epoll
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -23,6 +26,8 @@
|
||||||
regexp: '^(\s*use)\s+.+;'
|
regexp: '^(\s*use)\s+.+;'
|
||||||
line: ' use epoll;'
|
line: ' use epoll;'
|
||||||
insertafter: 'events \{'
|
insertafter: 'events \{'
|
||||||
|
tags:
|
||||||
|
- nginx
|
||||||
|
|
||||||
- name: Install Nginx http configuration
|
- name: Install Nginx http configuration
|
||||||
copy:
|
copy:
|
||||||
|
@ -32,7 +37,7 @@
|
||||||
# force: yes
|
# force: yes
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
tags:
|
tags:
|
||||||
- nginx
|
- nginx
|
||||||
|
|
||||||
# TODO: verify that those permissions are correct :
|
# TODO: verify that those permissions are correct :
|
||||||
# not too strict for private_ipaddr_whitelist
|
# not too strict for private_ipaddr_whitelist
|
||||||
|
@ -49,7 +54,7 @@
|
||||||
force: no
|
force: no
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
tags:
|
tags:
|
||||||
- nginx
|
- nginx
|
||||||
|
|
||||||
- name: add IP addresses to private IP whitelist
|
- name: add IP addresses to private IP whitelist
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -58,6 +63,8 @@
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ nginx_private_ipaddr_whitelist_present }}"
|
with_items: "{{ nginx_private_ipaddr_whitelist_present }}"
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
|
tags:
|
||||||
|
- nginx
|
||||||
|
|
||||||
- name: remove IP addresses from private IP whitelist
|
- name: remove IP addresses from private IP whitelist
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -66,6 +73,8 @@
|
||||||
state: absent
|
state: absent
|
||||||
with_items: "{{ nginx_private_ipaddr_whitelist_absent }}"
|
with_items: "{{ nginx_private_ipaddr_whitelist_absent }}"
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
|
tags:
|
||||||
|
- nginx
|
||||||
|
|
||||||
- name: Copy private_htpasswd
|
- name: Copy private_htpasswd
|
||||||
copy:
|
copy:
|
||||||
|
@ -78,7 +87,7 @@
|
||||||
force: no
|
force: no
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
tags:
|
tags:
|
||||||
- nginx
|
- nginx
|
||||||
|
|
||||||
- name: add user:pwd to private htpasswd
|
- name: add user:pwd to private htpasswd
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -87,6 +96,8 @@
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ nginx_private_htpasswd_present }}"
|
with_items: "{{ nginx_private_htpasswd_present }}"
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
|
tags:
|
||||||
|
- nginx
|
||||||
|
|
||||||
- name: remove user:pwd from private htpasswd
|
- name: remove user:pwd from private htpasswd
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -95,6 +106,8 @@
|
||||||
state: absent
|
state: absent
|
||||||
with_items: "{{ nginx_private_htpasswd_absent }}"
|
with_items: "{{ nginx_private_htpasswd_absent }}"
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
|
tags:
|
||||||
|
- nginx
|
||||||
|
|
||||||
- name: Verify that the service is enabled and started
|
- name: Verify that the service is enabled and started
|
||||||
service:
|
service:
|
||||||
|
@ -102,21 +115,26 @@
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: started
|
state: started
|
||||||
tags:
|
tags:
|
||||||
- nginx
|
- nginx
|
||||||
|
|
||||||
- name: Check if Munin is installed
|
- name: Check if Munin is installed
|
||||||
stat:
|
stat:
|
||||||
path: /etc/munin/plugin-conf.d/munin-node
|
path: /etc/munin/plugin-conf.d/munin-node
|
||||||
register: stat_munin_node
|
register: stat_munin_node
|
||||||
tags:
|
tags:
|
||||||
- munin
|
- nginx
|
||||||
|
- munin
|
||||||
|
|
||||||
- include: munin_vhost.yml
|
- include: munin_vhost.yml
|
||||||
when: stat_munin_node.stat.exists
|
when: stat_munin_node.stat.exists
|
||||||
tags:
|
tags:
|
||||||
- munin
|
- nginx
|
||||||
|
- munin
|
||||||
|
|
||||||
- include: munin_graphs.yml
|
- include: munin_graphs.yml
|
||||||
when: stat_munin_node.stat.exists
|
when: stat_munin_node.stat.exists
|
||||||
tags:
|
tags:
|
||||||
- munin
|
- nginx
|
||||||
|
- munin
|
||||||
|
|
||||||
|
- include: logrotate.yml
|
||||||
|
|
6
postgresql/tasks/logrotate.yml
Normal file
6
postgresql/tasks/logrotate.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
- name: logrotate configuration
|
||||||
|
copy:
|
||||||
|
src: logrotate_postgresql
|
||||||
|
dest: /etc/logrotate.d/postgresql
|
||||||
|
force: no
|
|
@ -4,3 +4,4 @@
|
||||||
- include: config.yml
|
- include: config.yml
|
||||||
- include: nrpe.yml
|
- include: nrpe.yml
|
||||||
- include: munin.yml
|
- include: munin.yml
|
||||||
|
- include: logrotate.yml
|
||||||
|
|
6
squid/tasks/logrotate.yml
Normal file
6
squid/tasks/logrotate.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
- name: logrotate configuration
|
||||||
|
copy:
|
||||||
|
src: logrotate_squid3
|
||||||
|
dest: /etc/logrotate.d/squid3
|
||||||
|
force: no
|
|
@ -11,6 +11,11 @@
|
||||||
dest: /etc/squid3/squid.conf
|
dest: /etc/squid3/squid.conf
|
||||||
notify: restart squid
|
notify: restart squid
|
||||||
|
|
||||||
|
- name: logrotate configuration
|
||||||
|
copy:
|
||||||
|
src: logrotate_squid3
|
||||||
|
dest: /etc/logrotate.d/squid3
|
||||||
|
|
||||||
- name: evolix whitelist is present
|
- name: evolix whitelist is present
|
||||||
copy:
|
copy:
|
||||||
src: whitelist-evolinux.conf
|
src: whitelist-evolinux.conf
|
||||||
|
@ -26,6 +31,8 @@
|
||||||
force: no
|
force: no
|
||||||
notify: restart squid
|
notify: restart squid
|
||||||
|
|
||||||
|
- include: logrotate.yml
|
||||||
|
|
||||||
- include: minifirewall.yml
|
- include: minifirewall.yml
|
||||||
|
|
||||||
- include: log2mail.yml
|
- include: log2mail.yml
|
||||||
|
|
Loading…
Reference in a new issue