diff --git a/roles/coturn/tasks/update.yml b/roles/coturn/tasks/update.yml index 0d951bf..6a7388e 100644 --- a/roles/coturn/tasks/update.yml +++ b/roles/coturn/tasks/update.yml @@ -7,15 +7,15 @@ template: src: docker-compose.yaml dest: "{{ coturn_project_dir }}/docker-compose.yaml" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' - name: Template turnserver.conf to project directory template: src: turnserver.conf dest: "{{ coturn_project_dir }}/turnserver.conf" - owner: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" mode: '640' # Store result to restart services if the file changed register: coturn_template_turnserver_result diff --git a/roles/dockerd/tasks/main.yml b/roles/dockerd/tasks/main.yml index 3ed475a..7134a86 100644 --- a/roles/dockerd/tasks/main.yml +++ b/roles/dockerd/tasks/main.yml @@ -42,9 +42,9 @@ regex: '^export DOCKER_HOST=' line: "export DOCKER_HOST=unix:///run/user/{{ host_uid }}/docker.sock" -- name: "Make sure lingering is enabled for user {{ ansible_env['USER'] }}" +- name: "Make sure lingering is enabled for user {{ host_uid }}" command: - cmd: "loginctl enable-linger {{ ansible_env['USER'] }}" + cmd: "loginctl enable-linger {{ host_uid }}" become: true - name: "Create directory {{ ansible_env['HOME'] }}/.config/systemd/user/docker.service.d" diff --git a/roles/element/tasks/update.yml b/roles/element/tasks/update.yml index 43eaee5..c5638b6 100644 --- a/roles/element/tasks/update.yml +++ b/roles/element/tasks/update.yml @@ -7,16 +7,16 @@ template: src: docker-compose.yaml dest: "{{ element_project_dir }}/docker-compose.yaml" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' - name: Template config.json to project directory template: src: config.json dest: "{{ element_project_dir }}/config.json" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '644' register: element_template_config_result diff --git a/roles/etebase/tasks/update.yml b/roles/etebase/tasks/update.yml index bd70730..a459924 100644 --- a/roles/etebase/tasks/update.yml +++ b/roles/etebase/tasks/update.yml @@ -7,16 +7,16 @@ template: src: docker-compose.yaml dest: "{{ etebase_project_dir }}/docker-compose.yaml" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' - name: Template etebase-server.ini to project directory template: src: etebase-server.ini dest: "{{ etebase_project_dir }}/etebase-server.ini" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '644' - name: "Create directory {{ volumes['etebase_datadir'] }} with correct permissions" diff --git a/roles/hedgedoc/tasks/update.yml b/roles/hedgedoc/tasks/update.yml index ca70510..d9ffe0b 100644 --- a/roles/hedgedoc/tasks/update.yml +++ b/roles/hedgedoc/tasks/update.yml @@ -7,8 +7,8 @@ template: src: docker-compose.yaml dest: "{{ hedgedoc_project_dir }}/docker-compose.yaml" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' - name: "Create directory {{ volumes['hedgedoc_configdir'] }} with correct permissions" diff --git a/roles/homepage/tasks/update.yml b/roles/homepage/tasks/update.yml index 7a983bf..0f4ba4f 100644 --- a/roles/homepage/tasks/update.yml +++ b/roles/homepage/tasks/update.yml @@ -7,8 +7,8 @@ template: src: docker-compose.yaml dest: "{{ homepage_project_dir }}/docker-compose.yaml" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' - name: Pull project services diff --git a/roles/mailserver/tasks/update.yml b/roles/mailserver/tasks/update.yml index 463a48d..618e36a 100644 --- a/roles/mailserver/tasks/update.yml +++ b/roles/mailserver/tasks/update.yml @@ -7,8 +7,8 @@ template: src: docker-compose.yaml dest: "{{ mailserver_project_dir }}/docker-compose.yaml" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' - name: "Create directory {{ volumes['mailserver_datadir'] }} with correct permissions" diff --git a/roles/searxng/tasks/update.yml b/roles/searxng/tasks/update.yml index ac1d947..50ceae4 100644 --- a/roles/searxng/tasks/update.yml +++ b/roles/searxng/tasks/update.yml @@ -7,16 +7,16 @@ template: src: docker-compose.yaml dest: "{{ searxng_project_dir }}/docker-compose.yaml" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' - name: Copy settings.yml and limiter.toml to project directory copy: src: "{{ role_path }}/files/" dest: "{{ searxng_project_dir }}" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '644' # Store result to restart services if the file(s) changed register: searxng_copy_files_result diff --git a/roles/synapse/tasks/update.yml b/roles/synapse/tasks/update.yml index 0c4ab57..d722781 100644 --- a/roles/synapse/tasks/update.yml +++ b/roles/synapse/tasks/update.yml @@ -7,15 +7,15 @@ template: src: docker-compose.yaml dest: "{{ synapse_project_dir }}/docker-compose.yaml" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' - name: Template homeserver.yaml to project directory template: src: homeserver.yaml dest: "{{ synapse_project_dir }}/homeserver.yaml" - owner: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" mode: '640' # Store result to restart services if the file changed register: synapse_template_homeserver_result diff --git a/roles/syncthing/tasks/update.yml b/roles/syncthing/tasks/update.yml index bc9bdfe..e9e592d 100644 --- a/roles/syncthing/tasks/update.yml +++ b/roles/syncthing/tasks/update.yml @@ -7,8 +7,8 @@ template: src: docker-compose.yaml dest: "{{ syncthing_project_dir }}/docker-compose.yaml" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' - name: Pull project services diff --git a/roles/uptime-kuma/tasks/update.yml b/roles/uptime-kuma/tasks/update.yml index 2b97ca6..d0c010b 100644 --- a/roles/uptime-kuma/tasks/update.yml +++ b/roles/uptime-kuma/tasks/update.yml @@ -7,8 +7,8 @@ template: src: docker-compose.yaml dest: "{{ uptime_kuma_project_dir }}/docker-compose.yaml" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' - name: "Create directory {{ volumes['uptime_kuma_datadir'] }} with correct permissions" diff --git a/roles/vaultwarden/tasks/update.yml b/roles/vaultwarden/tasks/update.yml index aadb898..7db2e53 100644 --- a/roles/vaultwarden/tasks/update.yml +++ b/roles/vaultwarden/tasks/update.yml @@ -7,8 +7,8 @@ template: src: "{{ item }}" dest: "{{ vaultwarden_project_dir }}/{{ item }}" - owner: "{{ ansible_env['USER'] }}" - group: "{{ ansible_env['USER'] }}" + owner: "{{ host_uid }}" + group: "{{ host_uid }}" mode: '640' loop: - docker-compose.yaml