mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
# Apache
|
|
|
|
- name: Remove symlink /etc/apache2/sites-enabled/awstats.conf
|
|
file:
|
|
path: /etc/apache2/sites-enabled/awstats.conf
|
|
state: absent
|
|
when: not awstats_enabled or nginx_enabled
|
|
|
|
#- name: 'Install from template: /etc/{{ apache_config_dir }}/awstats.conf'
|
|
# template:
|
|
# src: apache-awstats.conf
|
|
# dest: "/etc/{{ apache_config_dir }}/awstats.conf"
|
|
# owner: root # Not nec? Remove?
|
|
# group: root # Not nec? Remove?
|
|
# mode: 0644 # Not nec? Remove?
|
|
# when: not nginx_enabled
|
|
|
|
- name: Symlink /etc/apache2/sites-enabled/awstats.conf -> /etc/{{ apache_config_dir }}/awstats.conf
|
|
file:
|
|
src: "/etc/{{ apache_config_dir }}/awstats.conf"
|
|
path: /etc/apache2/sites-enabled/awstats.conf
|
|
state: link
|
|
when: awstats_enabled and not nginx_enabled
|
|
|
|
- name: Restart Apache systemd service ({{ apache_service }})
|
|
systemd:
|
|
name: "{{ apache_service }}"
|
|
state: restarted
|
|
when: awstats_enabled and not nginx_enabled
|
|
|
|
# NGINX
|
|
|
|
- name: Remove {{ nginx_config_dir }}/awstats-nginx.conf
|
|
file:
|
|
path: "{{ nginx_config_dir }}/awstats-nginx.conf"
|
|
state: absent
|
|
when: not awstats_enabled or not nginx_enabled
|
|
|
|
- name: 'Install from template: /etc/nginx/cgi-bin.php, {{ nginx_config_dir }}/awstats-nginx.conf'
|
|
template:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
owner: root # Not nec? Remove?
|
|
group: root # Not nec? Remove?
|
|
mode: 0644 # Not nec? Remove?
|
|
with_items:
|
|
- { src: "awstats-nginx.conf", dest: "{{ nginx_config_dir }}/" }
|
|
- { src: "cgi-bin.php", dest: "/etc/nginx/" }
|
|
when: awstats_enabled and nginx_enabled
|
|
|
|
- name: Restart nginx systemd service
|
|
systemd:
|
|
name: nginx
|
|
daemon_reload: yes
|
|
state: restarted
|
|
when: nginx_enabled | bool
|
|
|
|
- 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 }}"
|