Skip to content
Snippets Groups Projects
Verified Commit df387f02 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Make systemd configuration optional

parent 6074dda1
No related branches found
No related tags found
1 merge request!6CI tests
...@@ -138,6 +138,7 @@ Role Variables ...@@ -138,6 +138,7 @@ Role Variables
| `funkwhale_ssl_cert_path` | `` | Path to an existing SSL certificate to use (use in combination with `funkwhale_letsencrypt_enabled: false`) | | `funkwhale_ssl_cert_path` | `` | Path to an existing SSL certificate to use (use in combination with `funkwhale_letsencrypt_enabled: false`) |
| `funkwhale_ssl_key_path` | `` | Path to an existing SSL key to use (use in combination with `funkwhale_letsencrypt_enabled: false`) | | `funkwhale_ssl_key_path` | `` | Path to an existing SSL key to use (use in combination with `funkwhale_letsencrypt_enabled: false`) |
| `funkwhale_static_path` | `/srv/funkwhale/data/static` | Path were Funkwhale static files should be stored | | `funkwhale_static_path` | `/srv/funkwhale/data/static` | Path were Funkwhale static files should be stored |
| `funkwhale_systemd_managed` | `true` | If `true`, will configure Funkwhale systemd services |
| `funkwhale_systemd_after` | `redis.service postgresql.service` | Configuration used for Systemd `After=` directive. Modify it if you have a database or redis server on a separate host | | `funkwhale_systemd_after` | `redis.service postgresql.service` | Configuration used for Systemd `After=` directive. Modify it if you have a database or redis server on a separate host |
| `funkwhale_systemd_service_name` | `funkwhale` | Name of the generated Systemd service, e.g when calling `systemctl start <xxx>` | | `funkwhale_systemd_service_name` | `funkwhale` | Name of the generated Systemd service, e.g when calling `systemctl start <xxx>` |
| `funkwhale_username` | `funkwhale` | Username of the system user and owner of Funkwhale data, files and configuration | | `funkwhale_username` | `funkwhale` | Username of the system user and owner of Funkwhale data, files and configuration |
......
...@@ -21,6 +21,7 @@ funkwhale_web_workers: 1 ...@@ -21,6 +21,7 @@ funkwhale_web_workers: 1
funkwhale_protocol: https funkwhale_protocol: https
funkwhale_settings_module: config.settings.production funkwhale_settings_module: config.settings.production
funkwhale_env_vars: [] funkwhale_env_vars: []
funkwhale_systemd_managed: true
funkwhale_systemd_after: redis.service postgresql.service funkwhale_systemd_after: redis.service postgresql.service
funkwhale_systemd_service_name: funkwhale funkwhale_systemd_service_name: funkwhale
funkwhale_letsencrypt_certbot_flags: funkwhale_letsencrypt_certbot_flags:
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
- name: reload funkwhale - name: reload funkwhale
become: true become: true
when: funkwhale_systemd_managed
shell: | shell: |
systemctl kill -s HUP {{ funkwhale_systemd_service_name }}-server systemctl kill -s HUP {{ funkwhale_systemd_service_name }}-server
systemctl kill -s HUP {{ funkwhale_systemd_service_name }}-worker systemctl kill -s HUP {{ funkwhale_systemd_service_name }}-worker
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
- name: "Create {{ funkwhale_systemd_service_name }}-* systemd file" - name: "Create {{ funkwhale_systemd_service_name }}-* systemd file"
become: true become: true
when: funkwhale_systemd_managed
template: template:
src: "funkwhale-process.service.j2" src: "funkwhale-process.service.j2"
dest: "/etc/systemd/system/{{ funkwhale_systemd_service_name }}-{{ item.name }}.service" dest: "/etc/systemd/system/{{ funkwhale_systemd_service_name }}-{{ item.name }}.service"
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
- name: "Create {{ funkwhale_systemd_service_name }} systemd target file" - name: "Create {{ funkwhale_systemd_service_name }} systemd target file"
become: true become: true
when: funkwhale_systemd_managed
template: template:
src: "{{ funkwhale_systemd_service_name }}.target.j2" src: "{{ funkwhale_systemd_service_name }}.target.j2"
dest: "/etc/systemd/system/{{ funkwhale_systemd_service_name }}.target" dest: "/etc/systemd/system/{{ funkwhale_systemd_service_name }}.target"
...@@ -30,6 +32,7 @@ ...@@ -30,6 +32,7 @@
- name: "Start and enable {{ funkwhale_systemd_service_name }}-* services" - name: "Start and enable {{ funkwhale_systemd_service_name }}-* services"
become: true become: true
when: funkwhale_systemd_managed
systemd: systemd:
name: "{{ item }}" name: "{{ item }}"
enabled: true enabled: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment