From 8352a09e32e54beece949e336e0f30ac44e13a80 Mon Sep 17 00:00:00 2001 From: Shu Shen Date: Fri, 26 Jun 2015 12:39:27 -0700 Subject: [PATCH] Ensure flush-net-cache on local host In a multiple host deployment, the deploying host (which runs the playbooks) may not be the host for the containers being destroyed. Therefore, flush-net-cache is not performed on the deploying host. This would cause connectivity problem between the deploying host and the containers before the staled net cache timed out ultimately. Therefore, the local host shall always perform flush-net-cache when a container is destroyed. Change-Id: Iac0afa58084d35d285067c404de85e3466ba62e9 Closes-Bug: #1469285 --- playbooks/lxc-containers-destroy.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/playbooks/lxc-containers-destroy.yml b/playbooks/lxc-containers-destroy.yml index 73c0cffd60..1131cfebbc 100644 --- a/playbooks/lxc-containers-destroy.yml +++ b/playbooks/lxc-containers-destroy.yml @@ -40,7 +40,7 @@ tags: - container-directories -- name: Destroy lxc containers +- name: Flush network cache on lxc host hosts: "hosts" max_fail_percentage: 20 gather_facts: false @@ -51,3 +51,16 @@ delegate_to: "{{ physical_host }}" tags: - flush-net-cache + +- name: Ensure flushing network cache on local host + hosts: 127.0.0.1 + connection: local + max_fail_percentage: 20 + gather_facts: false + user: root + tasks: + - name: Flush net cache + command: /usr/local/bin/lxc-system-manage flush-net-cache + tags: + - flush-net-cache + - flush-net-cache-local