mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 15:28:12 +02:00
Moved blocks to include_tasks to raise performance. Deploy was really slow
This commit is contained in:
23
roles/web-app-espocrm/tasks/01_patch_config.yml
Normal file
23
roles/web-app-espocrm/tasks/01_patch_config.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
- name: Update DB host
|
||||
command: >
|
||||
docker exec --user root {{ espocrm_name }}
|
||||
sed -i "s/'host' => .*/'host' => '{{ database_host }}',/" {{ espocrm_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB name
|
||||
command: >
|
||||
docker exec --user root {{ espocrm_name }}
|
||||
sed -i "s/'dbname' => .*/'dbname' => '{{ database_name }}',/" {{ espocrm_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB user
|
||||
command: >
|
||||
docker exec --user root {{ espocrm_name }}
|
||||
sed -i "s/'user' => .*/'user' => '{{ database_username }}',/" {{ espocrm_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB password
|
||||
command: >
|
||||
docker exec --user root {{ espocrm_name }}
|
||||
sed -i "s/'password' => .*/'password' => '{{ database_password }}',/" {{ espocrm_config_file }}
|
||||
notify: docker compose up
|
@@ -1,32 +0,0 @@
|
||||
- name: Check if config.php exists in EspoCRM
|
||||
command: docker exec --user root {{ espocrm_name }} test -f {{ espocrm_config_file }}
|
||||
register: config_file_exists
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Patch EspoCRM config.php with updated DB credentials
|
||||
when: config_file_exists.rc == 0
|
||||
block:
|
||||
- name: Update DB host
|
||||
command: >
|
||||
docker exec --user root {{ espocrm_name }}
|
||||
sed -i "s/'host' => .*/'host' => '{{ database_host }}',/" {{ espocrm_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB name
|
||||
command: >
|
||||
docker exec --user root {{ espocrm_name }}
|
||||
sed -i "s/'dbname' => .*/'dbname' => '{{ database_name }}',/" {{ espocrm_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB user
|
||||
command: >
|
||||
docker exec --user root {{ espocrm_name }}
|
||||
sed -i "s/'user' => .*/'user' => '{{ database_username }}',/" {{ espocrm_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB password
|
||||
command: >
|
||||
docker exec --user root {{ espocrm_name }}
|
||||
sed -i "s/'password' => .*/'password' => '{{ database_password }}',/" {{ espocrm_config_file }}
|
||||
notify: docker compose up
|
@@ -3,8 +3,15 @@
|
||||
include_role:
|
||||
name: cmp-db-docker-proxy
|
||||
|
||||
- name: Update database credentials
|
||||
include_tasks: database.yml
|
||||
- name: Check if config.php exists in EspoCRM
|
||||
command: docker exec --user root {{ espocrm_name }} test -f {{ espocrm_config_file }}
|
||||
register: config_file_exists
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Patch EspoCRM config.php with updated DB credentials
|
||||
include_tasks: 01_patch_config.yml
|
||||
when: config_file_exists.rc == 0
|
||||
|
||||
- name: Flush handlers to make DB available before password reset
|
||||
meta: flush_handlers
|
||||
|
Reference in New Issue
Block a user