Skip to content
Snippets Groups Projects
Verified Commit 168f1eb1 authored by jooola's avatar jooola
Browse files

chore: format files using pre-commit

parent 5594a195
No related branches found
No related tags found
1 merge request!32chore: add pre-commit tool
--- ---
stages: stages:
- test - test
- deploy - deploy
......
Funkwhale ansible role # Funkwhale ansible role
======================
An ansible role to install and update [Funkwhale](https://funkwhale.audio). An ansible role to install and update [Funkwhale](https://funkwhale.audio).
Summary ## Summary
-------
Using this role, you can install and upgrade a Funkwhale pod, closely matching our [standard installation guide](https://docs.funkwhale.audio/installation/debian.html). The role will take care of: Using this role, you can install and upgrade a Funkwhale pod, closely matching our [standard installation guide](https://docs.funkwhale.audio/installation/debian.html). The role will take care of:
...@@ -13,8 +11,7 @@ Using this role, you can install and upgrade a Funkwhale pod, closely matching o ...@@ -13,8 +11,7 @@ Using this role, you can install and upgrade a Funkwhale pod, closely matching o
- Install and configure Funkwhale and it's dependencies - Install and configure Funkwhale and it's dependencies
- Install and configure a SSL certificate with Let's Encrypt (optional) - Install and configure a SSL certificate with Let's Encrypt (optional)
Philosophy ## Philosophy
----------
This role strives to: This role strives to:
...@@ -25,8 +22,7 @@ This role strives to: ...@@ -25,8 +22,7 @@ This role strives to:
- Allow running multiple Funkwhale instances on the same host - Allow running multiple Funkwhale instances on the same host
- Avoid messing with existing software and apps on the server - Avoid messing with existing software and apps on the server
Installation and usage ## Installation and usage
----------------------
Install ansible: Install ansible:
...@@ -93,28 +89,27 @@ Launch the installation (in check mode, so nothing is applied): ...@@ -93,28 +89,27 @@ Launch the installation (in check mode, so nothing is applied):
``` ```
ansible-playbook --ask-become-pass -i inventory.ini playbook.yml --check --diff ansible-playbook --ask-become-pass -i inventory.ini playbook.yml --check --diff
``` ```
*On some hosts, you may need to install the `python-apt` package for check mode to work*.
_On some hosts, you may need to install the `python-apt` package for check mode to work_.
This command will show you the changes that would be applied to your system. If you are comfortable with them, This command will show you the changes that would be applied to your system. If you are comfortable with them,
rerun the same command without the `--check` flag. rerun the same command without the `--check` flag.
Once installation is complete, run `/srv/funkwhale/virtualenv/bin/python /srv/funkwhale/api/manage.py createsuperuser` to create your admin account. Once installation is complete, run `/srv/funkwhale/virtualenv/bin/python /srv/funkwhale/api/manage.py createsuperuser` to create your admin account.
Role Variables ## Role Variables
--------------
**Required variables** **Required variables**
| name | Example | Description | | name | Example | Description |
| ----------------------------- | ----------------------------- | --------------------------------------------- | | ----------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `funkwhale_hostname` | `yourdomain.funkwhale` | The domain name of your Funkwhale pod | | `funkwhale_hostname` | `yourdomain.funkwhale` | The domain name of your Funkwhale pod |
| `funkwhale_letsencrypt_email` | `contact@youremail.com` | The email to associate with your Let's Encrypt certificate (not needed if you set `funkwhale_letsencrypt_enabled: false`, see below) | | `funkwhale_letsencrypt_email` | `contact@youremail.com` | The email to associate with your Let's Encrypt certificate (not needed if you set `funkwhale_letsencrypt_enabled: false`, see below) |
**Optional variables** **Optional variables**
| name | Default | Description | | name | Default | Description |
| --------------------------------------- | ----------------------------- | --------------------------------------------- | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
| `funkwhale_api_ip` | `127.0.0.1` | IP address with which to bind the Funkwhale server | | `funkwhale_api_ip` | `127.0.0.1` | IP address with which to bind the Funkwhale server |
| `funkwhale_api_port` | `5000` | Port with which to bind the Funkwhale server | | `funkwhale_api_port` | `5000` | Port with which to bind the Funkwhale server |
| `funkwhale_config_path` | `/srv/funkwhale/config` | Path to Funkwhale's configuration directory | | `funkwhale_config_path` | `/srv/funkwhale/config` | Path to Funkwhale's configuration directory |
...@@ -154,41 +149,35 @@ If you want to install Funkwhale from source (e.g to try a nonproduction branch, ...@@ -154,41 +149,35 @@ If you want to install Funkwhale from source (e.g to try a nonproduction branch,
following variables: following variables:
| name | Default | Description | | name | Default | Description |
| --------------------------------------- | ----------------------------------------------------- | --------------------------------------------- | | ------------------------------- | ----------------------------------------------------- | --------------------------------------- |
| `funkwhale_install_from_source` | `false` | Install and build Funkwhale from source | | `funkwhale_install_from_source` | `false` | Install and build Funkwhale from source |
| `funkwhale_source_url` | `https://dev.funkwhale.audio/funkwhale/funkwhale.git` | URL to the git repository to use | | `funkwhale_source_url` | `https://dev.funkwhale.audio/funkwhale/funkwhale.git` | URL to the git repository to use |
Use the `funkwhale_version` variable to control the git tag/branch to checkout. Use the `funkwhale_version` variable to control the git tag/branch to checkout.
Supported platforms ## Supported platforms
-------------------
- Debian 9 - Debian 9
- More to come - More to come
Dependencies ## Dependencies
------------
This roles has no other dependencies. This roles has no other dependencies.
Tests ## Tests
-----
This role is tested using [molecule](https://molecule.readthedocs.io/en/stable/). This role is tested using [molecule](https://molecule.readthedocs.io/en/stable/).
We don't have CI yet, but you can run the tests with `molecule test`. We don't have CI yet, but you can run the tests with `molecule test`.
Todo ## Todo
----
- Backups - Backups
- Superuser creation - Superuser creation
License ## License
-------
AGPL3 AGPL3
Author Information ## Author Information
------------------
Contact us at https://funkwhale.audio/community/ Contact us at https://funkwhale.audio/community/
...@@ -51,9 +51,7 @@ ...@@ -51,9 +51,7 @@
db: "{{ funkwhale_database_name }}" db: "{{ funkwhale_database_name }}"
name: "{{ myext }}" name: "{{ myext }}"
login_user: postgres login_user: postgres
loop: ['unaccent', 'citext'] loop: ["unaccent", "citext"]
loop_control: loop_control:
loop_var: myext loop_var: myext
delegate_to: "{{ funkwhale_database_host_ansible or inventory_hostname }}" delegate_to: "{{ funkwhale_database_host_ansible or inventory_hostname }}"
...
--- ---
- name: Check latest version - name: Check latest version
when: funkwhale_version is not defined or funkwhale_version == "latest" when: funkwhale_version is not defined or funkwhale_version == "latest"
uri: uri:
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
owner: "{{ funkwhale_username }}" owner: "{{ funkwhale_username }}"
group: "{{ funkwhale_username }}" group: "{{ funkwhale_username }}"
state: directory state: directory
mode: '755' mode: "755"
with_items: with_items:
- "{{ funkwhale_install_path }}" - "{{ funkwhale_install_path }}"
- "{{ funkwhale_media_path }}" - "{{ funkwhale_media_path }}"
...@@ -58,7 +57,7 @@ ...@@ -58,7 +57,7 @@
copy: copy:
content: "{{ result_secret_key_generation.stdout }}" content: "{{ result_secret_key_generation.stdout }}"
dest: "{{ funkwhale_config_path }}/django_secret_key" dest: "{{ funkwhale_config_path }}/django_secret_key"
mode: '600' mode: "600"
- name: "Setup a dummy secret key" - name: "Setup a dummy secret key"
when: ansible_check_mode when: ansible_check_mode
...@@ -87,7 +86,6 @@ ...@@ -87,7 +86,6 @@
notify: notify:
- restart funkwhale - restart funkwhale
- name: Download front-end files - name: Download front-end files
become: true become: true
become_user: "{{ funkwhale_username }}" become_user: "{{ funkwhale_username }}"
...@@ -249,7 +247,6 @@ ...@@ -249,7 +247,6 @@
insertafter: "EOF" insertafter: "EOF"
block: "{{ funkwhale_custom_settings }}" block: "{{ funkwhale_custom_settings }}"
- name: "Collect static files" - name: "Collect static files"
command: "{{ funkwhale_install_path }}/virtualenv/bin/python api/manage.py collectstatic --no-input" command: "{{ funkwhale_install_path }}/virtualenv/bin/python api/manage.py collectstatic --no-input"
become: true become: true
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
template: template:
src: funkwhale_proxy.conf.j2 src: funkwhale_proxy.conf.j2
dest: "/etc/nginx/funkwhale_proxy.conf" dest: "/etc/nginx/funkwhale_proxy.conf"
mode: '644' mode: "644"
notify: notify:
- reload nginx - reload nginx
...@@ -76,6 +76,6 @@ ...@@ -76,6 +76,6 @@
template: template:
src: nginx.conf.j2 src: nginx.conf.j2
dest: "/etc/nginx/sites-enabled/{{ funkwhale_hostname }}.conf" dest: "/etc/nginx/sites-enabled/{{ funkwhale_hostname }}.conf"
mode: '644' mode: "644"
notify: notify:
- reload nginx - reload nginx
--- ---
- name: "Create {{ funkwhale_systemd_service_name }}-* systemd file" - name: "Create {{ funkwhale_systemd_service_name }}-* systemd file"
become: true become: true
when: funkwhale_systemd_managed when: funkwhale_systemd_managed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment