Install Nginx and Apache log configs

This commit is contained in:
Alex Kotov 2020-07-14 01:09:31 +05:00
parent f379f60e90
commit 366b226019
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
5 changed files with 36 additions and 0 deletions

2
files/apache/syslog.conf Normal file
View File

@ -0,0 +1,2 @@
CustomLog "| /usr/bin/logger -thttpd -plocal6.info" combined
ErrorLog "| /usr/bin/logger -thttpd -plocal6.error"

2
files/nginx/syslog.conf Normal file
View File

@ -0,0 +1,2 @@
access_log syslog:server=unix:/dev/log,tag=nginx,facility=local7,severity=info;
error_log syslog:server=unix:/dev/log,tag=nginx,facility=local7,severity=error;

View File

@ -12,6 +12,8 @@
group: root
with_items:
- '{{ common__apache__conf_dir }}'
- '{{ common__apache__conf_available_dir }}'
- '{{ common__apache__conf_enabled_dir }}'
- '{{ common__apache__available_dir }}'
- '{{ common__apache__enabled_dir }}'
- '{{ common__apache__snippets_dir }}'
@ -32,6 +34,24 @@
line: 'Options FollowSymLinks'
notify: common | Restart Apache
- name: Install Apache log config
copy:
src: 'files/apache/syslog.conf'
dest: '{{ common__apache__conf_available_dir }}/syslog.conf'
mode: 'u=rw,g=r,o=r'
owner: root
group: root
notify: common | Restart Apache
- name: Enable Apache log config
file:
state: link
src: '{{ common__apache__conf_available_dir }}/syslog.conf'
dest: '{{ common__apache__conf_enabled_dir }}/syslog.conf'
owner: root
group: root
notify: common | Restart Apache
- name: Remove Apache default site
file:
state: absent

View File

@ -16,6 +16,16 @@
- '{{ common__nginx__available_dir }}'
- '{{ common__nginx__enabled_dir }}'
- '{{ common__nginx__snippets_dir }}'
notify: common | Restart Nginx
- name: Install Nginx log config
copy:
src: 'files/nginx/syslog.conf'
dest: '{{ common__nginx__confd_dir }}/syslog.conf'
mode: 'u=rw,g=r,o=r'
owner: root
group: root
notify: common | Restart Nginx
- name: Remove Nginx default site
file:

View File

@ -14,6 +14,8 @@ common__nginx__enabled_dir: '{{ common__nginx__conf_dir }}/sites-enabled'
common__nginx__snippets_dir: '{{ common__nginx__conf_dir }}/snippets'
common__apache__conf_dir: '/etc/apache2'
common__apache__conf_available_dir: '{{ common__apache__conf_dir }}/conf-available'
common__apache__conf_enabled_dir: '{{ common__apache__conf_dir }}/conf-enabled'
common__apache__available_dir: '{{ common__apache__conf_dir }}/sites-available'
common__apache__enabled_dir: '{{ common__apache__conf_dir }}/sites-enabled'
common__apache__snippets_dir: '{{ common__apache__conf_dir }}/snippets'