From 1a25a6219e1671252dfd2e526e94183f63f17d76 Mon Sep 17 00:00:00 2001 From: Enric Pou Date: Tue, 13 Aug 2024 10:23:58 +0200 Subject: [PATCH] fix: Fixed error when using external vars for defining container_name. (#61) --- handlers/main.yml | 2 +- tasks/install.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 20c99f1..e4a55d6 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,5 +1,5 @@ --- -- name: "restart container {{ container_name }}" +- name: "restart container" service: name: '{{ service_name }}.service' state: restarted diff --git a/tasks/install.yml b/tasks/install.yml index 1e7de37..dda14c3 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -7,7 +7,7 @@ group: root mode: '0600' when: container_env is defined - notify: restart container {{ container_name }} + notify: restart container - name: Pull image {{ container_image }} community.docker.docker_image: @@ -15,7 +15,7 @@ force_source: '{{ container_docker_pull_force_source | bool }}' source: pull when: container_docker_pull - notify: restart container {{ container_name }} + notify: restart container - name: Create unit {{ service_name }}.service template: @@ -24,7 +24,7 @@ owner: root group: root mode: '0644' - notify: restart container {{ container_name }} + notify: restart container - name: Enable and start {{ container_name }} systemd: