mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Update install.yml
This commit is contained in:
parent
70ce5ebd59
commit
e774c31b39
1 changed files with 19 additions and 21 deletions
|
@ -1,21 +1,19 @@
|
||||||
- name: Install AWStats package
|
- name: Install packages {awstats, pwauth, openssl}
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name:
|
||||||
state: present
|
|
||||||
with_items:
|
|
||||||
- awstats
|
- awstats
|
||||||
- pwauth
|
- pwauth
|
||||||
- openssl
|
- openssl
|
||||||
|
state: present
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
|
|
||||||
- name: Install AWStats package (debuntu)
|
- name: Install packages libapache2-mod-authnz-external and apache2-utils (debuntu)
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name:
|
||||||
state: present
|
|
||||||
with_items:
|
|
||||||
- libapache2-mod-authnz-external
|
- libapache2-mod-authnz-external
|
||||||
- apache2-utils
|
- apache2-utils
|
||||||
|
state: present
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
|
@ -37,7 +35,7 @@
|
||||||
- "{{ awstats_data_dir }}"
|
- "{{ awstats_data_dir }}"
|
||||||
- "{{ apache_log_dir }}"
|
- "{{ apache_log_dir }}"
|
||||||
|
|
||||||
- name: Install the Apache config for AWStats (debuntu)
|
- name: Install Apache's awstats.conf from template (debuntu)
|
||||||
template:
|
template:
|
||||||
src: apache.conf
|
src: apache.conf
|
||||||
dest: "/etc/{{ apache_config_dir }}/awstats.conf"
|
dest: "/etc/{{ apache_config_dir }}/awstats.conf"
|
||||||
|
@ -46,7 +44,7 @@
|
||||||
mode: 0644
|
mode: 0644
|
||||||
when: awstats_enabled and is_debuntu
|
when: awstats_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Install the Apache config for AWStats (OS's other than debuntu)
|
- name: Install Apache's awstats.conf from template (OS's other than debuntu)
|
||||||
template:
|
template:
|
||||||
src: apache-awstats.conf
|
src: apache-awstats.conf
|
||||||
dest: "/etc/{{ apache_config_dir }}/awstats.conf"
|
dest: "/etc/{{ apache_config_dir }}/awstats.conf"
|
||||||
|
@ -55,35 +53,35 @@
|
||||||
mode: 0644
|
mode: 0644
|
||||||
when: awstats_enabled and not is_debuntu
|
when: awstats_enabled and not is_debuntu
|
||||||
|
|
||||||
- name: Make sure logrotate does not make logs unreadable (debuntu)
|
- name: Ensure logrotate doesn't make logs unreadable (debuntu)
|
||||||
template:
|
template:
|
||||||
src: logrotate.d.apache2
|
src: logrotate.d.apache2
|
||||||
dest: /etc/logrotate.d/apache2
|
dest: /etc/logrotate.d/apache2
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: See if AWStats package installed a config file
|
- name: Check if package installed /etc/awstats/awstats.conf
|
||||||
stat:
|
stat:
|
||||||
path: /etc/awstats/awstats.conf
|
path: /etc/awstats/awstats.conf
|
||||||
register: awstats
|
register: awstats
|
||||||
|
|
||||||
- name: If there was a config file installed by package, move it aside
|
- name: If so, move it aside to /etc/awstats/awstats.conf.dist
|
||||||
command: mv /etc/awstats/awstats.conf /etc/awstats/awstats.conf.dist
|
command: mv /etc/awstats/awstats.conf /etc/awstats/awstats.conf.dist
|
||||||
when: awstats.stat.islnk is defined and not awstats.stat.islnk
|
when: awstats.stat.islnk is defined and not awstats.stat.islnk
|
||||||
|
|
||||||
- name: Enable AWStats (debuntu)
|
- name: Create symlink awstats.conf from sites-enabled to sites-available (debuntu)
|
||||||
file:
|
file:
|
||||||
src: /etc/apache2/sites-available/awstats.conf
|
src: /etc/apache2/sites-available/awstats.conf
|
||||||
path: /etc/apache2/sites-enabled/awstats.conf
|
path: /etc/apache2/sites-enabled/awstats.conf
|
||||||
state: link
|
state: link
|
||||||
when: awstats_enabled and is_debuntu
|
when: awstats_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Disable AWStats (debuntu)
|
- name: Remove symlink from sites-enabled, to disable AWStats (debuntu)
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/awstats.conf
|
path: /etc/apache2/sites-enabled/awstats.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: not awstats_enabled and is_debuntu
|
when: not awstats_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Install the AWStats config
|
- name: Install /etc/awstats/awstats.schoolserver.conf
|
||||||
template:
|
template:
|
||||||
src: awstats.schoolserver.conf.j2
|
src: awstats.schoolserver.conf.j2
|
||||||
dest: /etc/awstats/awstats.schoolserver.conf
|
dest: /etc/awstats/awstats.schoolserver.conf
|
||||||
|
@ -92,10 +90,10 @@
|
||||||
mode: 0644
|
mode: 0644
|
||||||
when: awstats_enabled
|
when: awstats_enabled
|
||||||
|
|
||||||
- name: Create a symbolic link to use when access is by IP address
|
- name: Create a symlink /etc/awstats/awstats.conf for access by IP address
|
||||||
file:
|
file:
|
||||||
src: /etc/awstats/awstats.schoolserver.conf
|
src: /etc/awstats/awstats.schoolserver.conf
|
||||||
dest: /etc/awstats/awstats.conf
|
path: /etc/awstats/awstats.conf
|
||||||
state: link
|
state: link
|
||||||
when: awstats_enabled
|
when: awstats_enabled
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue