mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-10-10 18:58:10 +02:00
Refactor docker compose exec usage
Introduce centralized variables: - docker_compose_command_base - docker_compose_command_exec Replaced hardcoded 'docker compose exec' with '{{ docker_compose_command_exec }}' across multiple roles (BigBlueButton, EspoCRM, Friendica, Listmonk, Mailu, Matrix, OpenProject). Ensures consistent environment file loading and reduces duplicated code. Details: https://chatgpt.com/share/68d6a276-19d0-800f-839d-d191d97f7c41
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
- name: "Fetch existing API tokens via curl inside admin container"
|
||||
command: >-
|
||||
docker compose exec -T admin \
|
||||
{{ docker_compose_command_exec }} -T admin \
|
||||
curl -s -X GET {{ mailu_api_base_url }}/token \
|
||||
-H "Authorization: Bearer {{ MAILU_API_TOKEN }}"
|
||||
args:
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
- name: "Delete existing API token for '{{ mailu_user_key }};{{ mailu_user_name }}' if local token missing but remote exists"
|
||||
command: >-
|
||||
docker compose exec -T admin \
|
||||
{{ docker_compose_command_exec }} -T admin \
|
||||
curl -s -X DELETE {{ mailu_api_base_url }}/token/{{ mailu_user_existing_token.id }} \
|
||||
-H "Authorization: Bearer {{ MAILU_API_TOKEN }}"
|
||||
args:
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
- name: "Create API token for '{{ mailu_user_key }};{{ mailu_user_name }}' if no local token defined"
|
||||
command: >-
|
||||
docker compose exec -T admin
|
||||
{{ docker_compose_command_exec }} -T admin
|
||||
curl -sS -f -X POST {{ mailu_api_base_url }}/token
|
||||
-H "Authorization: Bearer {{ MAILU_API_TOKEN }}"
|
||||
-H "Content-Type: application/json"
|
||||
|
Reference in New Issue
Block a user