1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_etebase.git synced 2024-08-16 10:19:52 +02:00

Create venv for each etebase version

As inspired by https://github.com/roles-ansible/ansible_role_etebase/issues/9
This commit is contained in:
L3D 2022-11-15 23:50:49 +01:00
parent 1a8d3ccf7d
commit 750942f864
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 11 additions and 8 deletions

View file

@ -9,6 +9,7 @@ Ansible role to Setup and Confugure Etebase - The Backend from [EteSync](https:/
--------- ---------
This Ansible role installs and configures etebase, the backend of etesync. A piece of software to securely sync your contacts, calendars, tasks and notes! This Ansible role installs and configures etebase, the backend of etesync. A piece of software to securely sync your contacts, calendars, tasks and notes!
In this Ansible role, a separate user is created for etebase. The latest release of etebase is downloaded to the home of this user. A configuration is created. The specified Python dependencies are installed in a venv. And optionally etebase can be started automatically via a systemd service and uvicorn. In this Ansible role, a separate user is created for etebase. The latest release of etebase is downloaded to the home of this user. A configuration is created. The specified Python dependencies are installed in a venv. And optionally etebase can be started automatically via a systemd service and uvicorn.
This Ansible role does not create users in Etebase. And the configuration for the web server is not created either. More about this in the [Additional Information](#additional-information) section. This Ansible role does not create users in Etebase. And the configuration for the web server is not created either. More about this in the [Additional Information](#additional-information) section.
Default Variables Default Variables
@ -19,7 +20,7 @@ This Ansible role does not create users in Etebase. And the configuration for th
| etebase__group | ``etebase`` | The Unix Group for etebase | | etebase__group | ``etebase`` | The Unix Group for etebase |
| etebase__user_home | ``/var/lib/etebase`` | Etebase User Home | | etebase__user_home | ``/var/lib/etebase`` | Etebase User Home |
| etebase__shell | ``/bin/false`` | Default Shell of Etebase User | | etebase__shell | ``/bin/false`` | Default Shell of Etebase User |
| etebase__venv | ``{{ etebase__user_home }}/venv`` | Etebase venv path | | etebase__venv_path | ``{{ etebase__user_home }}/venv`` | Etebase venv path |
| etebase__socket | ``/tmp/etebase_server.sock`` | Etebase Socket path *(only if ``etebase__systemd_setup`` is set to ``true``)* | | etebase__socket | ``/tmp/etebase_server.sock`` | Etebase Socket path *(only if ``etebase__systemd_setup`` is set to ``true``)* |
| etebase__package_state | ``present`` | Set to ``latest`` to upgrade all etebase required system and pip packages to the latest version | | etebase__package_state | ``present`` | Set to ``latest`` to upgrade all etebase required system and pip packages to the latest version |
| etebase__version | ``latest`` | Etebase Release Tag | | etebase__version | ``latest`` | Etebase Release Tag |
@ -60,14 +61,15 @@ You have to create a admin User by yourself. To do this, log in manually as priv
cd /var/lib/etebase/ cd /var/lib/etebase/
# change to latest etebase version # change to latest etebase version
ls etebase_* ls -l etebase_*
cd etebase_v0.10.0 # example versiom cd etebase_v0.10.0 # example versiom
# enable venv # enable latest venv
source /var/lib/etebase/venv/bin/activate ls -l /var/lib/etebase/venv
source /var/lib/etebase/venv/v0.10.0/bin/activate # example version
# create new superuser # create new superuser
/var/lib/etebase/venv/bin/python3 ./manage.py createsuperuser python3 ./manage.py createsuperuser
``` ```
By the way, this role requires that the Ansible user be allowed to execute commands with sudo privileges. By the way, this role requires that the Ansible user be allowed to execute commands with sudo privileges.

View file

@ -4,7 +4,7 @@ etebase__group: 'etebase'
etebase__user: 'etebase' etebase__user: 'etebase'
etebase__user_home: '/var/lib/etebase' etebase__user_home: '/var/lib/etebase'
etebase__shell: '/bin/false' etebase__shell: '/bin/false'
etebase__venv: "{{ etebase__user_home }}/venv" etebase__venv_path: "{{ etebase__user_home }}/venv"
etebase__socket: '/tmp/etebase_server.sock' etebase__socket: '/tmp/etebase_server.sock'
# package state # package state

View file

@ -52,4 +52,4 @@
- name: Print hint how to create admin User - name: Print hint how to create admin User
ansible.builtin.debug: ansible.builtin.debug:
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
msg: "To create a admin user, run 'cd {{ etebase__user_home }}/etebase_{{ etebase_version_target }}; {{ etebase__venv }}/bin/python3 ./manage.py createsuperuser' as priviledged user." msg: "To create a admin user, run 'cd {{ etebase__user_home }}/etebase_{{ etebase_version_target }}; source {{ etebase__venv }}/bin/activate; python3 ./manage.py createsuperuser' as priviledged user."

View file

@ -1,7 +1,8 @@
--- ---
etebase__repo: 'https://github.com/etesync/server.git' etebase__repo: 'https://github.com/etesync/server.git'
etebase__repo_api: 'https://api.github.com/repos/etesync/server/tags' etebase__repo_api: 'https://api.github.com/repos/etesync/server/tags'
etebase__venv: "{{ etebase__venv_path }}/{{ etebase_version_target }}"
# versionscheck # versionscheck
playbook_version_number: 10 # should be a integer playbook_version_number: 11 # should be a integer
playbook_version_path: 'role-do1jlr.etebase' playbook_version_path: 'role-do1jlr.etebase'