# Apache - name: Enable http://box/awstats and/or http://box/awstats/awstats.pl via Apache command: a2ensite awstats.conf when: apache_install and awstats_enabled - name: Disable http://box/awstats and/or http://box/awstats/awstats.pl via Apache command: a2dissite awstats.conf when: apache_install and not awstats_enabled - name: Restart Apache systemd service ({{ apache_service }}) systemd: name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/.yml state: restarted when: apache_enabled | bool # NGINX - name: Enable http://box/awstats via NGINX, by installing /etc/nginx/cgi-bin.php & {{ nginx_config_dir }}/awstats-nginx.conf from template template: src: "{{ item.src }}" dest: "{{ item.dest }}" with_items: - { src: "awstats-nginx.conf", dest: "{{ nginx_config_dir }}/" } - { src: "cgi-bin.php", dest: "/etc/nginx/" } when: nginx_install and awstats_enabled - name: Disable http://box/awstats_url via NGINX, by removing {{ nginx_config_dir }}/awstats-nginx.conf file: path: "{{ nginx_config_dir }}/awstats-nginx.conf" state: absent when: nginx_install and not awstats_enabled - name: Restart 'nginx' systemd service systemd: name: nginx 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 | string }}" 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 }}"