mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 15:28:12 +02:00
Adapted roles to new architecture
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
include_role:
|
||||
name: cmp-db-docker-proxy
|
||||
|
||||
- name: "Update database credentials"
|
||||
- name: "Patch Matomo config.ini.php with updated DB credentials"
|
||||
include_tasks: database.yml
|
||||
|
||||
- name: flush docker service
|
||||
|
@@ -1,25 +1,16 @@
|
||||
- name: Backup config.ini.php before patching
|
||||
- name: Update DB host
|
||||
command: >
|
||||
docker cp {{ matomo_name }}:{{ matomo_config }} {{ matomo_backup_file }}
|
||||
|
||||
- name: Patch Matomo config.ini.php with updated DB credentials
|
||||
block:
|
||||
- name: Update DB host
|
||||
command: >
|
||||
docker exec --user root {{ matomo_name }}
|
||||
sed -i "s/^host *=.*/host = {{ database_host }}/" {{ matomo_config }}
|
||||
|
||||
- name: Update DB name
|
||||
command: >
|
||||
docker exec --user root {{ matomo_name }}
|
||||
sed -i "s/^dbname *=.*/dbname = {{ database_name }}/" {{ matomo_config }}
|
||||
|
||||
- name: Update DB user
|
||||
command: >
|
||||
docker exec --user root {{ matomo_name }}
|
||||
sed -i "s/^username *=.*/username = {{ database_username }}/" {{ matomo_config }}
|
||||
|
||||
- name: Update DB password
|
||||
command: >
|
||||
docker exec --user root {{ matomo_name }}
|
||||
sed -i "s/^password *=.*/password = {{ database_password }}/" {{ matomo_config }}
|
||||
docker exec --user root {{ matomo_name }}
|
||||
sed -i "s/^host *=.*/host = {{ database_host }}/" {{ matomo_config }}
|
||||
- name: Update DB name
|
||||
command: >
|
||||
docker exec --user root {{ matomo_name }}
|
||||
sed -i "s/^dbname *=.*/dbname = {{ database_name }}/" {{ matomo_config }}
|
||||
- name: Update DB user
|
||||
command: >
|
||||
docker exec --user root {{ matomo_name }}
|
||||
sed -i "s/^username *=.*/username = {{ database_username }}/" {{ matomo_config }}
|
||||
- name: Update DB password
|
||||
command: >
|
||||
docker exec --user root {{ matomo_name }}
|
||||
sed -i "s/^password *=.*/password = {{ database_password }}/" {{ matomo_config }}
|
||||
|
@@ -8,7 +8,6 @@ matomo_version: "{{ applications | get_app_conf(application_id, 'docker.se
|
||||
matomo_image: "{{ applications | get_app_conf(application_id, 'docker.services.matomo.image', True) }}"
|
||||
matomo_name: "{{ applications | get_app_conf(application_id, 'docker.services.matomo.name', True) }}"
|
||||
matomo_data: "{{ applications | get_app_conf(application_id, 'docker.volumes.data', True) }}"
|
||||
matomo_backup_file: "{{ docker_compose.directories.instance }}/config.ini.php.bak"
|
||||
matomo_config: "/var/www/html/config/config.ini.php"
|
||||
|
||||
# I don't know if this is still necessary
|
||||
|
Reference in New Issue
Block a user