mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-08-01 11:16:05 +10:00
Simplify the synapse-usage-exporter git ownership fix
The recursive chown in front of the git task already guarantees that git operates on a checkout owned by the user it becomes, so marking the path as a safe.directory on top of that protects against nothing. Drop the environment variables and condense the comment to a single line. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,11 +43,7 @@
|
|||||||
|
|
||||||
- when: "matrix_synapse_usage_exporter_container_image_self_build | bool"
|
- when: "matrix_synapse_usage_exporter_container_image_self_build | bool"
|
||||||
block:
|
block:
|
||||||
# A repository left behind with different file ownership (e.g. cloned by another user in the past)
|
# A checkout owned by a different user (a uid change, an earlier clone by another user, etc.) would make the git task below fail on ownership or permissions.
|
||||||
# would make the git update below fail, either with a permission error or with git's
|
|
||||||
# dubious-ownership protection kicking in (which manifests as a confusing
|
|
||||||
# "'origin' does not appear to be a git repository" error, because git ignores
|
|
||||||
# the repository's own configuration in that case).
|
|
||||||
- name: Ensure synapse-usage-exporter repository ownership is correct on self-build
|
- name: Ensure synapse-usage-exporter repository ownership is correct on self-build
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ matrix_synapse_usage_exporter_docker_src_files_path }}"
|
path: "{{ matrix_synapse_usage_exporter_docker_src_files_path }}"
|
||||||
@@ -64,10 +60,6 @@
|
|||||||
force: "yes"
|
force: "yes"
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ matrix_user_name }}"
|
become_user: "{{ matrix_user_name }}"
|
||||||
environment:
|
|
||||||
GIT_CONFIG_COUNT: "1"
|
|
||||||
GIT_CONFIG_KEY_0: safe.directory
|
|
||||||
GIT_CONFIG_VALUE_0: "{{ matrix_synapse_usage_exporter_docker_src_files_path }}"
|
|
||||||
register: matrix_synapse_usage_exporter_git_pull_results
|
register: matrix_synapse_usage_exporter_git_pull_results
|
||||||
|
|
||||||
- name: Check if synapse-usage-exporter Docker image exists
|
- name: Check if synapse-usage-exporter Docker image exists
|
||||||
|
|||||||
Reference in New Issue
Block a user