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
No related merge requests found
---
stages:
- test
- deploy
......
Funkwhale ansible role
======================
# Funkwhale ansible role
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:
......@@ -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 a SSL certificate with Let's Encrypt (optional)
Philosophy
----------
## Philosophy
This role strives to:
......@@ -25,8 +22,7 @@ This role strives to:
- Allow running multiple Funkwhale instances on the same host
- Avoid messing with existing software and apps on the server
Installation and usage
----------------------
## Installation and usage
Install ansible:
......@@ -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
```
*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,
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.
Role Variables
--------------
## Role Variables
**Required variables**
| name | Example | Description |
| ----------------------------- | ----------------------------- | --------------------------------------------- |
| ----------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `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) |
**Optional variables**
| name | Default | Description |
| --------------------------------------- | ----------------------------- | --------------------------------------------- |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
| `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_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,
following variables:
| name | Default | Description |
| --------------------------------------- | ----------------------------------------------------- | --------------------------------------------- |
| ------------------------------- | ----------------------------------------------------- | --------------------------------------- |
| `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 |
Use the `funkwhale_version` variable to control the git tag/branch to checkout.
Supported platforms
-------------------
## Supported platforms
- Debian 9
- More to come
Dependencies
------------
## Dependencies
This roles has no other dependencies.
Tests
-----
## Tests
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`.
Todo
----
## Todo
- Backups
- Superuser creation
License
-------
## License
AGPL3
Author Information
------------------
## Author Information
Contact us at https://funkwhale.audio/community/
......@@ -51,9 +51,7 @@
db: "{{ funkwhale_database_name }}"
name: "{{ myext }}"
login_user: postgres
loop: ['unaccent', 'citext']
loop: ["unaccent", "citext"]
loop_control:
loop_var: myext
delegate_to: "{{ funkwhale_database_host_ansible or inventory_hostname }}"
...
---
- name: Check latest version
when: funkwhale_version is not defined or funkwhale_version == "latest"
uri:
......@@ -31,7 +30,7 @@
owner: "{{ funkwhale_username }}"
group: "{{ funkwhale_username }}"
state: directory
mode: '755'
mode: "755"
with_items:
- "{{ funkwhale_install_path }}"
- "{{ funkwhale_media_path }}"
......@@ -58,7 +57,7 @@
copy:
content: "{{ result_secret_key_generation.stdout }}"
dest: "{{ funkwhale_config_path }}/django_secret_key"
mode: '600'
mode: "600"
- name: "Setup a dummy secret key"
when: ansible_check_mode
......@@ -87,7 +86,6 @@
notify:
- restart funkwhale
- name: Download front-end files
become: true
become_user: "{{ funkwhale_username }}"
......@@ -249,7 +247,6 @@
insertafter: "EOF"
block: "{{ funkwhale_custom_settings }}"
- name: "Collect static files"
command: "{{ funkwhale_install_path }}/virtualenv/bin/python api/manage.py collectstatic --no-input"
become: true
......
......@@ -66,7 +66,7 @@
template:
src: funkwhale_proxy.conf.j2
dest: "/etc/nginx/funkwhale_proxy.conf"
mode: '644'
mode: "644"
notify:
- reload nginx
......@@ -76,6 +76,6 @@
template:
src: nginx.conf.j2
dest: "/etc/nginx/sites-enabled/{{ funkwhale_hostname }}.conf"
mode: '644'
mode: "644"
notify:
- reload nginx
---
- name: "Create {{ funkwhale_systemd_service_name }}-* systemd file"
become: true
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