From e7ecd16360e75dc107ccd5134d8e5051016ab34e Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Tue, 22 Apr 2025 06:04:41 +0200 Subject: [PATCH] Refactor ansible_env.HOME usage --- handlers.yml | 2 +- host_vars/fudiggity/syncthing.yml | 8 ++++---- tasks/setup.yml | 2 +- tasks/syncthing.yml | 2 +- tasks/transmission.yml | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/handlers.yml b/handlers.yml index 16f8612..e3927a7 100644 --- a/handlers.yml +++ b/handlers.yml @@ -33,4 +33,4 @@ - name: Compile wezterm terminfo file become: true when: wezterm_copy.changed - ansible.builtin.command: 'tic -x {{ ansible_env.HOME }}/.terminfo' + ansible.builtin.command: tic -x /home/sonny/.terminfo diff --git a/host_vars/fudiggity/syncthing.yml b/host_vars/fudiggity/syncthing.yml index 9a77ec7..4816b55 100644 --- a/host_vars/fudiggity/syncthing.yml +++ b/host_vars/fudiggity/syncthing.yml @@ -25,8 +25,8 @@ syncthing_devices: syncthing_folders: - id: default label: Default - path: '/var/syncthing/default' - source_path: '{{ ansible_env.HOME }}/files/sync/' + path: /var/syncthing/default + source_path: /home/sonny/files/sync/ type: sendreceive devices: - *syncthing_desktop_id @@ -35,8 +35,8 @@ syncthing_folders: - id: pictures label: Pictures - path: '/var/syncthing/pictures' - source_path: '{{ ansible_env.HOME }}/files/pictures/' + path: /var/syncthing/pictures + source_path: /home/sonny/files/pictures/ type: sendreceive devices: - *syncthing_desktop_id diff --git a/tasks/setup.yml b/tasks/setup.yml index 547af4a..e9cbb6f 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -19,7 +19,7 @@ - name: Copy wezterm terminfo file ansible.builtin.copy: src: 'files/wezterm.terminfo' - dest: '{{ ansible_env.HOME }}/.terminfo' + dest: /home/sonny/.terminfo mode: '0755' notify: Compile wezterm terminfo file diff --git a/tasks/syncthing.yml b/tasks/syncthing.yml index f72646a..877b45d 100644 --- a/tasks/syncthing.yml +++ b/tasks/syncthing.yml @@ -27,7 +27,7 @@ - name: Remove previous Syncthing configurations become: true ansible.builtin.file: - path: '{{ ansible_env.HOME }}/.config/syncthing' + path: /home/sonny/.config/syncthing state: absent - name: Copy docker compose configuration diff --git a/tasks/transmission.yml b/tasks/transmission.yml index c96f69f..31385b4 100644 --- a/tasks/transmission.yml +++ b/tasks/transmission.yml @@ -39,13 +39,13 @@ path: '{{ item }}' state: absent loop: - - '/etc/systemd/system/transmission-daemon.service.d' - - '{{ ansible_env.HOME }}/.config/transmission-daemon' + - /etc/systemd/system/transmission-daemon.service.d + - /home/sonny/.config/transmission-daemon - name: Copy Dockerfile become: true ansible.builtin.copy: - src: 'files/transmission/Dockerfile' + src: files/transmission/Dockerfile dest: '{{ transmission_app_dir }}/Dockerfile' owner: sonny group: sonny @@ -54,7 +54,7 @@ - name: Copy docker compose configuration become: true ansible.builtin.template: - src: 'templates/transmission/docker-compose.j2' + src: templates/transmission/docker-compose.j2 dest: '{{ transmission_app_dir }}/docker-compose.yml' owner: sonny group: sonny @@ -78,7 +78,7 @@ - name: Copy NGINX configuration become: true ansible.builtin.template: - src: 'templates/transmission/nginx.j2' + src: templates/transmission/nginx.j2 dest: '{{ transmission_app_dir }}/nginx.conf.d/default.conf' owner: sonny group: sonny