small fix to the role after final testing

This commit is contained in:
muppeth 2024-02-29 01:15:43 +01:00
parent 81ac7e7d4f
commit 9ec12fc503
Signed by: muppeth
GPG Key ID: 0EBC7B9848D04031
2 changed files with 5 additions and 10 deletions

View File

@ -17,6 +17,7 @@ lacre_apt:
- 'python3-pip' - 'python3-pip'
- 'python3-dev' - 'python3-dev'
- 'python3-full' - 'python3-full'
- 'python3-mysqldb'
- 'libssl-dev' - 'libssl-dev'
- 'swig' - 'swig'
- 'virtualenv' - 'virtualenv'

View File

@ -28,26 +28,20 @@
group: '{{ lacre_group }}' group: '{{ lacre_group }}'
mode: '700' mode: '700'
- name: '[Install] - Create a symbolic link to python binary'
file:
src: '/usr/bin/python{{ lacre_python_version }}'
dest: '/usr/bin/python'
state: 'link'
- name: '[INSTALL] - Install lacre backend requirenments' - name: '[INSTALL] - Install lacre backend requirenments'
pip: pip:
requirements: "{{ lacre_app_dir }}/requirements.txt" requirements: "{{ lacre_app_dir }}/requirements.txt"
virtualenv: '{{ lacre_homedir }}/venv' virtualenv: '{{ lacre_homedir }}/venv'
virtualenv_site_packages: yes virtualenv_site_packages: yes
- name: '[Install] - Link GnuPG Lacre to global python modules' - name: '[Install] - Link GnuPG Lacre to virtualenv python modules'
file: file:
src: '{{ lacre_app_dir }}/GnuPG' src: '{{ lacre_app_dir }}/GnuPG'
dest: '{{ lacre_homedir }}/venv/lib/python{{ lacre_python_version }}/site-packages/GnuPG' dest: '{{ lacre_homedir }}/venv/lib/python{{ lacre_python_version }}/site-packages/GnuPG'
state: link state: link
- name: '[Install] - Link Lacre module to global python modules' - name: '[Install] - Link Lacre module to virtualenv python modules'
file: file:
src: '{{ lacre_app_dir }}/lacre' src: '{{ lacre_app_dir }}/lacre'
dest: '{{ lacre_homedir }}/venv/lib/python{{ lacre_python_version }}/site-packages/lacre' dest: '{{ lacre_homedir }}/venv/lib/python{{ lacre_python_version }}/site-packages/lacre'
@ -72,7 +66,7 @@
month: "*" month: "*"
weekday: "*" weekday: "*"
user: "{{ lacre_username }}" user: "{{ lacre_username }}"
job: '{{ lacre_app_dir }}/webgate-cron.py > /dev/null' job: '{{ lacre_homedir }}/venv/bin/python{{ lacre_python_version }} {{ lacre_app_dir }}/webgate-cron.py > /dev/null'
when: lacre_webgate_cron == 'true' when: lacre_webgate_cron == 'true'
- name: Check if the database exists - name: Check if the database exists
@ -83,7 +77,7 @@
- name: '[INSTALL] - Run dbschema' - name: '[INSTALL] - Run dbschema'
shell: shell:
cmd: '{{ lacre_homedir }}/venv/bin/python{{ lacre_python_version }} -m {{ lacre_app_dir }}/lacre/admin.py db -i' cmd: '{{ lacre_homedir }}/venv/bin/python{{ lacre_python_version }} {{ lacre_app_dir }}/lacre/admin.py db -i'
become: 'yes' become: 'yes'
become_user: '{{ lacre_username }}' become_user: '{{ lacre_username }}'
when: lacre_db_info.stdout != '3' when: lacre_db_info.stdout != '3'