mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
Moved blocks to include_tasks to raise performance. Deploy was really slow
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
- name: flush handlers to ensure that friendica is up before friendica addon configuration
|
||||
meta: flush_handlers
|
||||
|
||||
- name: Check if Friendica local.config.php exists
|
||||
command: docker exec --user {{ friendica_user }} {{ friendica_container }} test -f {{ friendica_config_file }}
|
||||
register: friendica_config_exists
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Patch Friendica local.config.php with updated DB credentials
|
||||
when: friendica_config_exists.rc == 0
|
||||
block:
|
||||
- name: Update DB host
|
||||
command: >
|
||||
docker exec --user {{ friendica_user }} {{ friendica_container }}
|
||||
sed -ri "s/('hostname'\s*=>\s*')[^']*(',)/\1{{ database_host }}:{{ database_port }}\2/" {{ friendica_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB name
|
||||
command: >
|
||||
docker exec --user {{ friendica_user }} {{ friendica_container }}
|
||||
sed -ri "s/('database'\s*=>\s*')[^']*(',)/\1{{ database_name }}\2/" {{ friendica_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB user
|
||||
command: >
|
||||
docker exec --user {{ friendica_user }} {{ friendica_container }}
|
||||
sed -ri "s/('username'\s*=>\s*')[^']*(',)/\1{{ database_username }}\2/" {{ friendica_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB password
|
||||
command: >
|
||||
docker exec --user {{ friendica_user }} {{ friendica_container }}
|
||||
sed -ri "s/('password'\s*=>\s*')[^']*(',)/\1{{ database_password }}\2/" {{ friendica_config_file }}
|
||||
notify: docker compose up
|
23
roles/web-app-friendica/tasks/02_patch_config.yml
Normal file
23
roles/web-app-friendica/tasks/02_patch_config.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
- name: Update DB host
|
||||
command: >
|
||||
docker exec --user {{ friendica_user }} {{ friendica_container }}
|
||||
sed -ri "s/('hostname'\s*=>\s*')[^']*(',)/\1{{ database_host }}:{{ database_port }}\2/" {{ friendica_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB name
|
||||
command: >
|
||||
docker exec --user {{ friendica_user }} {{ friendica_container }}
|
||||
sed -ri "s/('database'\s*=>\s*')[^']*(',)/\1{{ database_name }}\2/" {{ friendica_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB user
|
||||
command: >
|
||||
docker exec --user {{ friendica_user }} {{ friendica_container }}
|
||||
sed -ri "s/('username'\s*=>\s*')[^']*(',)/\1{{ database_username }}\2/" {{ friendica_config_file }}
|
||||
notify: docker compose up
|
||||
|
||||
- name: Update DB password
|
||||
command: >
|
||||
docker exec --user {{ friendica_user }} {{ friendica_container }}
|
||||
sed -ri "s/('password'\s*=>\s*')[^']*(',)/\1{{ database_password }}\2/" {{ friendica_config_file }}
|
||||
notify: docker compose up
|
@@ -7,8 +7,19 @@
|
||||
include_tasks: 01_ldap.yml
|
||||
when: applications | get_app_conf(application_id, 'features.ldap', False)
|
||||
|
||||
- name: Update Friendica DB credentials
|
||||
include_tasks: 02_database.yml
|
||||
# General
|
||||
- name: "flush handlers to ensure that '{{ friendica_container }}' is up before executing container tasks"
|
||||
meta: flush_handlers
|
||||
|
||||
- name: Check if Friendica local.config.php exists
|
||||
command: docker exec --user {{ friendica_user }} {{ friendica_container }} test -f {{ friendica_config_file }}
|
||||
register: friendica_config_exists
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Patch Friendica local.config.php with updated DB credentials
|
||||
include_tasks: 02_patch_config.yml
|
||||
when: friendica_config_exists.rc == 0
|
||||
|
||||
- name: Add Friendica Add Ons
|
||||
include_tasks: 03_addons.yml
|
Reference in New Issue
Block a user