1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

Merge pull request #2793 from holta/awstats-deps-cleanup

awstats/tasks/install.yml: sorting out Apache vs. NGINX dependencies (WIP)
This commit is contained in:
A Holt 2021-05-21 11:18:29 -04:00 committed by GitHub
commit 5729f35059
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,31 +1,29 @@
# TO DO:
#
# - Prepare for a possible future w/o Apache by verifying/refining below...
# - 5 'when: apache_installed is defined'
# - 1 'when: nginx_install'
# - 8 core stanzas w/o such 'when:' clauses
# Prepare for a possible future w/o Apache by verifying/refining below...
# - 5 'when: apache_installed is defined' (2021-05-21: COMMENT OUT THESE STANZAS SOON!?)
# - 1 'when: nginx_install'
# - 8 core stanzas w/o such 'when:' clauses
- name: 'Install 3 packages: awstats, openssl, pwauth'
- name: 'Install package: awstats'
package:
name:
- awstats
- pwauth
- openssl
name: awstats
state: present
- name: 'Install 2 packages: apache2-utils, libapache2-mod-authnz-external'
- name: 'Install package: pwauth (when: apache_installed is defined)'
package:
name:
- libapache2-mod-authnz-external
- apache2-utils
- pwauth # Auto-installs apache2-bin and libapache2-mod-authnz-external
#- apache2-utils # Unneeded? (In any case, already installed by Apache itself.)
#- openssl # Unneeded? (In any case, already installed by most every Linux distro.)
state: present
when: apache_installed is defined
- name: Run 'a2enmod cgi' to enable cgi execution via Apache
- name: "Run 'a2enmod cgi' to enable cgi execution via Apache (when: apache_installed is defined)"
command: a2enmod cgi
when: apache_installed is defined
- name: Create directory... mkdir {{ apache_log_dir }}, recursively chown {{ apache_user }}:{{ apache_user }}, with chmod u+rw,g+r,g-w,o-rwx
- name: 'Create directory... mkdir {{ apache_log_dir }}, recursively chown {{ apache_user }}:{{ apache_user }}, with chmod u+rw,g+r,g-w,o-rwx (when: apache_installed is defined)'
file:
state: directory
recurse: yes
@ -41,7 +39,7 @@
state: directory
recurse: yes
path: "{{ item }}"
owner: "{{ apache_user }}"
owner: "{{ apache_user }}" # USED FOR NGINX TOO: 'www-data' on debuntu
group: "{{ apache_user }}"
mode: u+rw,g+r,g-w,o-rwx # '0750' turned on too many x bits
#force: yes
@ -49,13 +47,13 @@
- "{{ awstats_data_dir }}" # /library/awstats
- /usr/lib/cgi-bin/awstats # create backward compatible path for awstats
- name: Install /etc/{{ apache_conf_dir }}/awstats.conf from template
- name: 'Install /etc/{{ apache_conf_dir }}/awstats.conf from template (when: apache_installed is defined)'
template:
src: apache-awstats.conf
dest: "/etc/{{ apache_conf_dir }}/awstats.conf" # apache2/sites-available on debuntu
when: apache_installed is defined
- name: Install /etc/logrotate.d/apache2 from template, to ensure logrotate doesn't make logs unreadable
- name: "Install /etc/logrotate.d/apache2 from template, to ensure logrotate doesn't make logs unreadable (when: apache_installed is defined)"
template:
src: logrotate.d.apache2
dest: /etc/logrotate.d/apache2