2022-11-12 16:25:43 +01:00
|
|
|
---
|
|
|
|
- name: Run python3 manage.py migrate
|
|
|
|
become: true
|
|
|
|
ansible.builtin.command:
|
|
|
|
chdir: "{{ etebase__user_home }}/etebase_{{ etebase_version_target }}"
|
|
|
|
cmd: "{{ etebase__venv }}/bin/python3 ./manage.py migrate"
|
|
|
|
changed_when: _etebase_download.changed or _etebase_config.changed
|
2022-11-12 23:52:49 +01:00
|
|
|
register: _etebase_migrate
|
|
|
|
|
|
|
|
- name: Print output of python3 manage.py migrate
|
|
|
|
ansible.builtin.debug:
|
|
|
|
verbosity: 1
|
2022-11-14 01:42:00 +01:00
|
|
|
msg: "{{ _etebase_migrate.stdout }}"
|
2022-11-12 16:34:21 +01:00
|
|
|
|
|
|
|
- name: Create static files
|
|
|
|
become: true
|
|
|
|
ansible.builtin.command:
|
|
|
|
chdir: "{{ etebase__user_home }}/etebase_{{ etebase_version_target }}"
|
|
|
|
cmd: "{{ etebase__venv }}/bin/python3 ./manage.py collectstatic"
|
2022-11-12 18:10:49 +01:00
|
|
|
creates: "{{ etebase__global_static_root }}/admin"
|
2022-11-12 23:52:49 +01:00
|
|
|
register: _etebase_collectstatic
|
2022-11-17 01:33:35 +01:00
|
|
|
notify:
|
|
|
|
- "Systemctl restart etebase.service"
|
|
|
|
- "Systemctl restart webserver"
|
2022-11-12 23:52:49 +01:00
|
|
|
|
|
|
|
- name: Print output of python3 manage.py collectstatic
|
|
|
|
ansible.builtin.debug:
|
|
|
|
verbosity: 1
|
2022-11-14 01:42:00 +01:00
|
|
|
msg: "{{ _etebase_collectstatic.stdout }}"
|
2022-11-12 18:10:49 +01:00
|
|
|
|
2022-11-12 21:04:29 +01:00
|
|
|
- name: "Fix File Permissions for secret directory"
|
2022-11-12 18:10:49 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
group: "{{ etebase__group }}"
|
|
|
|
owner: "{{ etebase__user }}"
|
|
|
|
recurse: true
|
|
|
|
mode: 'u=rwX,g=rX,o='
|
|
|
|
with_items:
|
|
|
|
- "{{ etebase__secrets_dir }}"
|
2022-11-12 21:04:29 +01:00
|
|
|
|
|
|
|
- name: "Fix File Permissions for static data directory"
|
|
|
|
become: true
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
group: "{{ etebase__group }}"
|
|
|
|
owner: "{{ etebase__user }}"
|
|
|
|
recurse: true
|
|
|
|
mode: 'u=rwX,g=rX,o=rX'
|
|
|
|
with_items:
|
|
|
|
- "{{ etebase__global_static_root }}"
|
2022-11-12 23:52:49 +01:00
|
|
|
|
|
|
|
- name: Print hint how to create admin User
|
|
|
|
ansible.builtin.debug:
|
2022-11-14 01:42:00 +01:00
|
|
|
# yamllint disable-line rule:line-length
|
2022-11-15 23:50:49 +01:00
|
|
|
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."
|