mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
47 lines
1.8 KiB
YAML
47 lines
1.8 KiB
YAML
- name: Create symlink internetarchive.conf from sites-enabled to sites-available, for short URL http://box/archive (if debuntu and internetarchive_enabled)
|
|
file:
|
|
src: /etc/apache2/sites-available/internetarchive.conf
|
|
path: /etc/apache2/sites-enabled/internetarchive.conf
|
|
state: link
|
|
when: is_debuntu and internetarchive_enabled
|
|
|
|
- name: Remove symlink /etc/apache2/sites-enabled/internetarchive.conf (if debuntu and not internetarchive_enabled)
|
|
file:
|
|
path: /etc/apache2/sites-enabled/internetarchive.conf
|
|
state: absent
|
|
when: is_debuntu and not internetarchive_enabled
|
|
|
|
# RESTART/ENABLE SYSTEMD SERVICE
|
|
- name: Disable 'internetarchive' systemd service (if not internetarchive_enabled)
|
|
systemd:
|
|
name: internetarchive
|
|
enabled: no
|
|
when: not internetarchive_enabled
|
|
|
|
- name: Enable & Restart 'internetarchive' systemd service (if internetarchive_enabled)
|
|
systemd:
|
|
name: internetarchive
|
|
daemon_reload: yes
|
|
enabled: yes
|
|
state: restarted
|
|
when: internetarchive_enabled | bool
|
|
|
|
- name: Restart Apache service ({{ apache_service }}) to enable/disable http://box/archive (not just http://box:{{ internetarchive_port }})
|
|
systemd:
|
|
name: "{{ apache_service }}" # httpd or apache2
|
|
state: restarted
|
|
when: internetarchive_enabled | bool
|
|
|
|
- name: Add 'internetarchive' variable values to {{ iiab_ini_file }}
|
|
ini_file:
|
|
path: "{{ iiab_ini_file }}"
|
|
section: internetarchive
|
|
option: "{{ item.option }}"
|
|
value: "{{ item.value | string }}"
|
|
with_items:
|
|
- option: name
|
|
value: Internet Archive Offline
|
|
- option: description
|
|
value: '"Dweb-mirror is intended to make the Internet Archive experience and UI available offline."'
|
|
- option: internetarchive_enabled
|
|
value: "{{ internetarchive_enabled }}"
|