Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB

---
- name: Deploy configuration
template: src={{ item }}.j2 dest={{ paperless_root_dir }}/app/{{ item }} group={{ paperless_user }} mode=640
loop:
- paperless.conf
- gunicorn.conf.py
notify: restart paperless
tags: ged
- when: paperless_install_mode != 'none'
block:
- name: Migrate database
django_manage:
command: migrate
app_path: "{{ paperless_root_dir }}/app/src"
virtualenv: "{{ paperless_root_dir }}/venv"
notify: restart paperless
- name: Collect static files
django_manage:
command: collectstatic
app_path: "{{ paperless_root_dir }}/app/src"
virtualenv: "{{ paperless_root_dir }}/venv"
tags: ged
- when: paperless_install_mode == 'install'
block:
- name: Create admin user
django_manage:
command: createsuperuser --noinput --username admin --email admin@{{ ansible_domain }}
app_path: "{{ paperless_root_dir }}/app/src"
virtualenv: "{{ paperless_root_dir }}/venv"
environment:
DJANGO_SUPERUSER_PASSWORD: '{{ paperless_admin_pass }}'
tags: ged