--- - 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