From 41df5aa19d9298ea263a6e3e262ce6aba0f07b20 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Tue, 6 Dec 2016 10:31:38 +0000 Subject: [PATCH] Remove the -d flag to libvirtd when using systemd If using systemd the -d flag will cause the service to always run and the service start/stop will not properly manage the daemon. This should make sure the behavior is not changed when using upstart. Change-Id: I9d9d98c92b977965b73c10ce37e4b8896723f2bf Closes-Bug: 1647637 --- tasks/nova_compute_kvm.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/nova_compute_kvm.yml b/tasks/nova_compute_kvm.yml index b96b43bc..b29e9ec5 100644 --- a/tasks/nova_compute_kvm.yml +++ b/tasks/nova_compute_kvm.yml @@ -56,10 +56,10 @@ - nova-kvm - nova-libvirt -- name: Set libvirt runtime options (Ubuntu) +- name: Set libvirt runtime options when listening on tcp (Ubuntu) lineinfile: dest: "/etc/default/libvirt-bin" - line: 'libvirtd_opts="-d -l"' + line: 'libvirtd_opts="{% if ansible_service_mgr != "systemd" %}-d{% endif%} -l"' regexp: "^libvirtd_opts=" backup: "yes" when: @@ -70,10 +70,10 @@ - nova-kvm - nova-libvirt -- name: Set libvirt runtime options (Ubuntu) +- name: Set libvirt runtime options when not listening on tcp (Ubuntu) lineinfile: dest: "/etc/default/libvirt-bin" - line: 'libvirtd_opts="-d"' + line: 'libvirtd_opts="{% if ansible_service_mgr != "systemd" %}-d{% endif%}"' regexp: "^libvirtd_opts=" backup: "yes" when: