mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
awstats split and iiab_installed
This commit is contained in:
parent
5e7fdfe87b
commit
d26d6fa4e0
4 changed files with 98 additions and 16 deletions
58
roles/awstats/tasks/enable.yml
Normal file
58
roles/awstats/tasks/enable.yml
Normal file
|
@ -0,0 +1,58 @@
|
|||
- name: Create symlink awstats.conf from sites-enabled to sites-available (debuntu)
|
||||
file:
|
||||
src: /etc/apache2/sites-available/awstats.conf
|
||||
path: /etc/apache2/sites-enabled/awstats.conf
|
||||
state: link
|
||||
when: awstats_enabled and is_debuntu
|
||||
|
||||
- name: Remove symlink from sites-enabled, to disable AWStats (debuntu)
|
||||
file:
|
||||
path: /etc/apache2/sites-enabled/awstats.conf
|
||||
state: absent
|
||||
when: not awstats_enabled and is_debuntu
|
||||
|
||||
- name: Restart Apache service ({{ apache_service }})
|
||||
systemd:
|
||||
name: "{{ apache_service }}"
|
||||
state: restarted
|
||||
|
||||
- name: Install /etc/awstats/awstats.schoolserver.conf
|
||||
template:
|
||||
src: awstats.schoolserver.conf.j2
|
||||
dest: /etc/awstats/awstats.schoolserver.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: awstats_enabled | bool
|
||||
|
||||
- name: Create a symlink /etc/awstats/awstats.conf for access by IP address
|
||||
file:
|
||||
src: /etc/awstats/awstats.schoolserver.conf
|
||||
path: /etc/awstats/awstats.conf
|
||||
state: link
|
||||
when: awstats_enabled | bool
|
||||
|
||||
- name: On first enabling of AWStats, summarize httpd logs up to now (OS's other than debuntu)
|
||||
shell: /bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=schoolserver -update
|
||||
when: awstats_enabled and not is_debuntu
|
||||
|
||||
- name: On first enabling of AWStats, summarize httpd logs up to now (debuntu)
|
||||
shell: /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -config=schoolserver -update
|
||||
when: awstats_enabled and is_debuntu
|
||||
|
||||
- name: Add 'awstats' variable values to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
path: "{{ iiab_ini_file }}"
|
||||
section: awstats
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
with_items:
|
||||
- option: name
|
||||
value: AWStats
|
||||
- option: description
|
||||
value: '"AWStats (originally known as Advanced Web Statistics) is a package written in Perl which generates static or dynamic html summaries based upon web server logs."'
|
||||
- option: installed
|
||||
value: "{{ awstats_install }}"
|
||||
- option: enabled
|
||||
value: "{{ awstats_enabled }}"
|
||||
|
|
@ -93,3 +93,8 @@
|
|||
- name: On first enabling of AWStats, summarize httpd logs up to now (debuntu)
|
||||
shell: /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -config=schoolserver -update
|
||||
when: awstats_enabled and is_debuntu
|
||||
|
||||
- name: Add 'awstats_installed' variable values to {{ iiab_installed }}
|
||||
ini_file:
|
||||
path: "{{ iiab_installed }}"
|
||||
value: awstats_installed
|
||||
|
|
|
@ -1,19 +1,7 @@
|
|||
- name: Install AWStats if awstats_install
|
||||
include_tasks: install.yml
|
||||
when: awstats_install | bool
|
||||
when: awstats_install | bool and not awstats_installed is defined
|
||||
|
||||
- name: Add 'awstats' variable values to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
path: "{{ iiab_ini_file }}"
|
||||
section: awstats
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
with_items:
|
||||
- option: name
|
||||
value: AWStats
|
||||
- option: description
|
||||
value: '"AWStats (originally known as Advanced Web Statistics) is a package written in Perl which generates static or dynamic html summaries based upon web server logs."'
|
||||
- option: installed
|
||||
value: "{{ awstats_install }}"
|
||||
- option: enabled
|
||||
value: "{{ awstats_enabled }}"
|
||||
- name: Enable AWStats
|
||||
include_tasks: enable.yml
|
||||
when: awstats_install | bool or awstats_installed is defined
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
- download
|
||||
when: not is_debuntu
|
||||
|
||||
##### nginx only #####
|
||||
- name: Install /etc/munin/munin.conf and Apache's munin24.conf, from templates
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
|
@ -68,6 +69,36 @@
|
|||
- /usr/share/munin/plugins/mysql_threads
|
||||
when: mysql_enabled | bool
|
||||
|
||||
- name: Create symlink for awstats.pl from cgi-bin/awstats/awstats.pl to ../ so that the old apache links to awstats will work after change to nginx
|
||||
file:
|
||||
src: /usr/lib/cgi-bin/awstats.pl
|
||||
path: /usr/lib/cgi-bin/awstats/awstats.pl
|
||||
state: link
|
||||
|
||||
- name: Install /etc/awstats/awstats.schoolserver.conf
|
||||
template:
|
||||
src: awstats.schoolserver.conf.j2
|
||||
dest: /etc/awstats/awstats.schoolserver.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: awstats_enabled | bool
|
||||
|
||||
- name: Create a symlink /etc/awstats/awstats.conf for access by IP address
|
||||
file:
|
||||
src: /etc/awstats/awstats.schoolserver.conf
|
||||
path: /etc/awstats/awstats.conf
|
||||
state: link
|
||||
when: awstats_enabled | bool
|
||||
|
||||
- name: On first enabling of AWStats, summarize httpd logs up to now (OS's other than debuntu)
|
||||
shell: /bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=schoolserver -update
|
||||
when: awstats_enabled and not is_debuntu
|
||||
|
||||
- name: On first enabling of AWStats, summarize httpd logs up to now (debuntu)
|
||||
shell: /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -config=schoolserver -update
|
||||
when: awstats_enabled and is_debuntu
|
||||
|
||||
- name: Add 'munin' variable values to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
path: "{{ iiab_ini_file }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue