summaryrefslogtreecommitdiffstats
path: root/roles/awstats
diff options
context:
space:
mode:
authorMichael Scherer <misc@redhat.com>2021-04-21 17:03:38 +0200
committerMichael Scherer <misc@redhat.com>2021-04-21 17:03:38 +0200
commit978a6c928cd0b6d420dcf15e349776c8bfc65ebc (patch)
tree1f5770565875126d3bd17afc7c46bb0ad9c2e899 /roles/awstats
parentf7c1a22758671df53783b46549784c9f562910bf (diff)
Add awstats logs
Diffstat (limited to 'roles/awstats')
-rw-r--r--roles/awstats/meta/main.yml3
-rw-r--r--roles/awstats/tasks/main.yml18
-rw-r--r--roles/awstats/templates/awstats.conf7
-rw-r--r--roles/awstats/templates/logs.conf2
4 files changed, 30 insertions, 0 deletions
diff --git a/roles/awstats/meta/main.yml b/roles/awstats/meta/main.yml
new file mode 100644
index 0000000..791037b
--- /dev/null
+++ b/roles/awstats/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+- { role: httpd }
diff --git a/roles/awstats/tasks/main.yml b/roles/awstats/tasks/main.yml
new file mode 100644
index 0000000..3c08700
--- /dev/null
+++ b/roles/awstats/tasks/main.yml
@@ -0,0 +1,18 @@
+---
+- name: Install package
+ package:
+ name:
+ - awstats
+ state: present
+
+- template:
+ src: awstats.conf
+ dest: "/etc/awstats/awstats.{{ item }}.conf"
+ with_items: "{{ vhosts }}"
+
+- template:
+ src: logs.conf
+ dest: "/etc/httpd/conf.d/{{ item }}.conf.d/logs.conf"
+ with_items: "{{ vhosts }}"
+ notify: verify config and restart httpd
+
diff --git a/roles/awstats/templates/awstats.conf b/roles/awstats/templates/awstats.conf
new file mode 100644
index 0000000..13a4d96
--- /dev/null
+++ b/roles/awstats/templates/awstats.conf
@@ -0,0 +1,7 @@
+LogFile="/var/log/httpd/{{ item }}_ssl_access.fixed.log"
+LogType=W
+LogFormat="%time1 %host %other %other %methodurl %bytesd"
+SiteDomain={{ item }}
+DNSLookup=1
+DynamicDNSLookup=1
+BuildReportFormat=xhtml
diff --git a/roles/awstats/templates/logs.conf b/roles/awstats/templates/logs.conf
new file mode 100644
index 0000000..e8a1965
--- /dev/null
+++ b/roles/awstats/templates/logs.conf
@@ -0,0 +1,2 @@
+CustomLog logs/{{ item }}_ssl_access.fixed.log combined
+