kimai: Add argspec, sane defaults, upgrade if requested, fixes
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
---
|
||||
|
||||
- name: Clone kimai git repo
|
||||
ansible.builtin.git:
|
||||
repo: "https://github.com/kevinpapst/kimai2.git"
|
||||
dest: "{{ kimai_installdir }}"
|
||||
version: main
|
||||
update: "{{ kimai_upgrade }}"
|
||||
|
||||
- name: Install kimai dependencies using composer
|
||||
community.general.composer:
|
||||
working_dir: "{{ kimai_installdir }}"
|
||||
composer_executable: "{{ composer_path | default(omit) }}"
|
||||
executable: "{{ kimai_php_executable | default(omit) }}"
|
||||
executable: "{{ kimai_php_executable }}"
|
||||
|
||||
- name: Configure kimai database
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ kimai_installdir }}/.env"
|
||||
regexp: "^DATABASE_URL=.*$"
|
||||
line: "\
|
||||
DATABASE_URL=mysql://{{ kimai_db_user | default(kimai_db) }}:{{ kimai_db_pw }}\
|
||||
DATABASE_URL=mysql://{{ kimai_db_user }}:{{ kimai_db_pw }}\
|
||||
@{{ kimai_db_host | default('localhost') }}:3306/{{ kimai_db }}\
|
||||
?charset=utf8&serverVersion={{ kimai_db_server }}"
|
||||
?charset=utf8&serverVersion={{ kimai_db_server_version }}"
|
||||
|
||||
- name: Run kimai install script
|
||||
ansible.builtin.command: "{{ kimai_php_executable + ' ' if kimai_php_executable is defined else '' }}bin/console kimai:install -n"
|
||||
ansible.builtin.command: "{{ kimai_php_executable ~ ' ' }}bin/console kimai:install -n"
|
||||
args:
|
||||
chdir: "{{ kimai_installdir }}"
|
||||
register: kimai_install
|
||||
changed_when: "'[OK] Already at the latest version' not in kimai_install.stdout"
|
||||
failed_when: "'[OK] Congratulations! Successfully installed Kimai' not in kimai_install.stdout"
|
||||
failed_when: "'[OK] Successfully installed Kimai' not in kimai_install.stdout"
|
||||
|
||||
- name: Add symlink to kimai public in webroot
|
||||
ansible.builtin.file:
|
||||
|
||||
Reference in New Issue
Block a user