From 270955fe0c289dd93aa9c659f9223a01f6b6518c Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 1 Feb 2019 14:57:02 -0500 Subject: [PATCH] nspawn: fix restart-service.yml service list filtering The service list filtering is supposed to look for all services that are prefixed with 'service_name', however, we are not doing that in the regex. When using nspawn and restarting a service such as 'nova', it matches the systemd-nspawn service for the container and attempts to reload it which fails. This fixes it by forcing it to check for services *prefixed* with that variable. Change-Id: Ib1a3975f2722127eada2dd957300fd306abbe6d9 --- playbooks/common-tasks/restart-service.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/common-tasks/restart-service.yml b/playbooks/common-tasks/restart-service.yml index 67eaeb7c0a..9410ca6cb0 100644 --- a/playbooks/common-tasks/restart-service.yml +++ b/playbooks/common-tasks/restart-service.yml @@ -23,7 +23,7 @@ # - service_action: The action to execute [stop, start, restart, reload]. - name: Gather service list - shell: "systemctl list-unit-files --state=enabled --type=service | awk '/{{ service_name }}.* enabled$/ {print $1}'" + shell: "systemctl list-unit-files --state=enabled --type=service | awk '/^{{ service_name }}.* enabled$/ {print $1}'" args: executable: "/bin/bash" register: _enabled_services