1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Update awstats/tasks/enable.yml

This commit is contained in:
A Holt 2020-01-10 18:18:12 -05:00 committed by GitHub
parent c6e674c87b
commit b02e03a3c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,45 +1,59 @@
- name: Create symlink awstats.conf from sites-enabled to sites-available (Apache) # Apache
file:
src: /etc/apache2/sites-available/awstats.conf
path: /etc/apache2/sites-enabled/awstats.conf
state: link
when: awstats_enabled and not nginx_enabled
- name: Remove symlink from sites-enabled, to disable AWStats (Apache) - name: Remove symlink /etc/apache2/sites-enabled/awstats.conf
file: file:
path: /etc/apache2/sites-enabled/awstats.conf path: /etc/apache2/sites-enabled/awstats.conf
state: absent state: absent
when: not awstats_enabled or nginx_enabled when: not awstats_enabled or nginx_enabled
- name: Install nginx's files from template #- name: 'Install from template: /etc/{{ apache_config_dir }}/awstats.conf'
template: # template:
src: "{{ item.src }}" # src: apache-awstats.conf
dest: "{{ item.dest }}" # dest: "/etc/{{ apache_config_dir }}/awstats.conf"
owner: root # owner: root # Not nec? Remove?
group: root # group: root # Not nec? Remove?
mode: 0644 # mode: 0644 # Not nec? Remove?
with_items: # when: not nginx_enabled
- { src: "awstats-nginx.conf", dest: "{{ nginx_config_dir }}/" }
- { src: "cgi-bin.php", dest: "/etc/nginx/" }
when: awstats_enabled and nginx_enabled
- name: Remove {{ nginx_config_dir }}/awstats-nginx.conf - name: Symlink /etc/apache2/sites-enabled/awstats.conf -> /etc/{{ apache_config_dir }}/awstats.conf
file: file:
path: "{{ nginx_config_dir }}/awstats-nginx.conf" src: "/etc/{{ apache_config_dir }}/awstats.conf"
state: absent path: /etc/apache2/sites-enabled/awstats.conf
when: not awstats_enabled state: link
when: awstats_enabled and not nginx_enabled
- name: Restart Apache service ({{ apache_service }}) - name: Restart Apache systemd service ({{ apache_service }})
systemd: systemd:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
when: awstats_enabled and not nginx_enabled when: awstats_enabled and not nginx_enabled
- name: Restart nginx service # 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: systemd:
name: nginx name: nginx
daemon_reload: yes
state: restarted state: restarted
when: awstats_enabled and nginx_enabled when: nginx_enabled | bool
- name: Add 'awstats' variable values to {{ iiab_ini_file }} - name: Add 'awstats' variable values to {{ iiab_ini_file }}
ini_file: ini_file: