2022-11-10 01:04:02 +01:00
|
|
|
---
|
2022-11-15 01:52:32 +01:00
|
|
|
- name: Update apt cache
|
|
|
|
become: true
|
|
|
|
ansible.builtin.apt:
|
|
|
|
cache_valid_time: 3600
|
|
|
|
update_cache: true
|
|
|
|
when:
|
|
|
|
- ansible_pkg_mgr == "apt"
|
|
|
|
|
2022-11-10 01:04:02 +01:00
|
|
|
- name: Install Python3 Virtualenv
|
|
|
|
become: true
|
|
|
|
ansible.builtin.package:
|
2023-10-30 01:50:26 +01:00
|
|
|
name: "{{ item }}"
|
2022-11-10 01:04:02 +01:00
|
|
|
state: present
|
2023-10-30 01:50:26 +01:00
|
|
|
loop:
|
|
|
|
- 'python3-virtualenv'
|
|
|
|
- 'python3-dev'
|
|
|
|
- 'python3-pip'
|
|
|
|
- 'python-is-python3'
|
2022-11-10 01:04:02 +01:00
|
|
|
|
|
|
|
- name: Install etebase python requirements in virtualenv
|
|
|
|
become: true
|
|
|
|
ansible.builtin.pip:
|
2022-11-10 22:47:17 +01:00
|
|
|
requirements: "{{ etebase__user_home }}/etebase_{{ etebase_version_target }}/requirements.txt"
|
|
|
|
virtualenv: "{{ etebase__venv }}"
|
|
|
|
state: "{{ etebase__package_state }}"
|
|
|
|
umask: "0027"
|
2022-11-17 01:33:35 +01:00
|
|
|
notify:
|
|
|
|
- "Systemctl restart etebase.service"
|
|
|
|
- "Systemctl restart webserver"
|
2022-11-10 22:47:17 +01:00
|
|
|
|
|
|
|
- name: Install etebase ASGI Server
|
|
|
|
become: true
|
|
|
|
ansible.builtin.pip:
|
|
|
|
name: 'uvicorn[standard]'
|
2022-11-10 00:23:42 +01:00
|
|
|
virtualenv: "{{ etebase__venv }}"
|
|
|
|
state: "{{ etebase__package_state }}"
|
2022-11-10 01:04:02 +01:00
|
|
|
umask: "0027"
|
2022-11-17 01:33:35 +01:00
|
|
|
notify:
|
|
|
|
- "Systemctl restart etebase.service"
|
|
|
|
- "Systemctl restart webserver"
|
2022-11-10 01:04:02 +01:00
|
|
|
|
|
|
|
- name: Fix venv File owner/group
|
|
|
|
become: true
|
|
|
|
ansible.builtin.file:
|
2022-11-10 00:23:42 +01:00
|
|
|
path: "{{ etebase__venv }}"
|
2022-11-10 01:04:02 +01:00
|
|
|
state: directory
|
|
|
|
mode: 'u=rwX,g=rX,o='
|
2022-11-10 22:47:17 +01:00
|
|
|
recurse: true
|
2022-11-10 00:23:42 +01:00
|
|
|
group: "{{ etebase__group }}"
|
|
|
|
owner: "{{ etebase__user }}"
|