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

47 lines
1.2 KiB
YAML
Raw Normal View History

2022-11-10 01:04:02 +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:
name: python3-virtualenv
state: present
- name: Install etebase python requirements in virtualenv
become: true
ansible.builtin.pip:
requirements: "{{ etebase__user_home }}/etebase_{{ etebase_version_target }}/requirements.txt"
virtualenv: "{{ etebase__venv }}"
state: "{{ etebase__package_state }}"
umask: "0027"
notify:
- "Systemctl restart etebase.service"
- "Systemctl restart webserver"
- 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"
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='
recurse: true
2022-11-10 00:23:42 +01:00
group: "{{ etebase__group }}"
owner: "{{ etebase__user }}"