mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-18 14:34:24 +02:00
Added credentials replacement draft for matomo
This commit is contained in:
parent
2529c7cdb3
commit
4f06f94023
@ -2,6 +2,9 @@
|
|||||||
include_role:
|
include_role:
|
||||||
name: cmp-db-docker-proxy
|
name: cmp-db-docker-proxy
|
||||||
|
|
||||||
|
- name: "Update database credentials"
|
||||||
|
include_tasks: database.yml
|
||||||
|
|
||||||
- name: flush docker service
|
- name: flush docker service
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
|
||||||
|
25
roles/web-app-matomo/tasks/database.yml
Normal file
25
roles/web-app-matomo/tasks/database.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
- name: Backup config.ini.php before patching
|
||||||
|
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 }}
|
@ -1,5 +1,6 @@
|
|||||||
{% include 'roles/docker-compose/templates/base.yml.j2' %}
|
{% include 'roles/docker-compose/templates/base.yml.j2' %}
|
||||||
application:
|
application:
|
||||||
|
container_name: {{ matomo_name }}
|
||||||
{% set container_port = 80 %}
|
{% set container_port = 80 %}
|
||||||
{% include 'roles/docker-container/templates/base.yml.j2' %}
|
{% include 'roles/docker-container/templates/base.yml.j2' %}
|
||||||
image: "{{ matomo_image }}:{{ matomo_version }}"
|
image: "{{ matomo_image }}:{{ matomo_version }}"
|
||||||
|
@ -6,7 +6,10 @@ matomo_index_php_url: "{{ domains | get_url(application_id, web_protocol) }}/ind
|
|||||||
matomo_auth_token: "{{ applications | get_app_conf(application_id, 'credentials.auth_token', True) }}"
|
matomo_auth_token: "{{ applications | get_app_conf(application_id, 'credentials.auth_token', True) }}"
|
||||||
matomo_version: "{{ applications | get_app_conf(application_id, 'docker.services.matomo.version', True) }}"
|
matomo_version: "{{ applications | get_app_conf(application_id, 'docker.services.matomo.version', True) }}"
|
||||||
matomo_image: "{{ applications | get_app_conf(application_id, 'docker.services.matomo.image', True) }}"
|
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_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
|
# I don't know if this is still necessary
|
||||||
domain: "{{ domains | get_domain(application_id) }}"
|
domain: "{{ domains | get_domain(application_id) }}"
|
Loading…
x
Reference in New Issue
Block a user