diff --git a/ansible/roles/semaphore/defaults/main.yml b/ansible/roles/semaphore/defaults/main.yml index 51afad1..5511e4f 100644 --- a/ansible/roles/semaphore/defaults/main.yml +++ b/ansible/roles/semaphore/defaults/main.yml @@ -83,6 +83,11 @@ semaphore_quadlet_dir: /etc/containers/systemd # container restarts and rebuilds. semaphore_collections_dir: /opt/semaphore/ansible-collections +# UID of the semaphore user inside the container (uid=1001). +# The host-side collections directory must be owned by this UID so the +# container process can write collections into the bind-mount. +semaphore_container_uid: 1001 + semaphore_ansible_collections: - name: containers.podman version: ">=1.10.0" diff --git a/ansible/roles/semaphore/tasks/collections.yml b/ansible/roles/semaphore/tasks/collections.yml index 8b7c082..7e59bbb 100644 --- a/ansible/roles/semaphore/tasks/collections.yml +++ b/ansible/roles/semaphore/tasks/collections.yml @@ -13,7 +13,7 @@ ansible.builtin.file: path: "{{ semaphore_collections_dir }}" state: directory - owner: root + owner: "{{ semaphore_container_uid }}" group: root mode: "0755"