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
This commit is contained in:
Shu Shen 2015-06-26 12:39:27 -07:00 committed by Ian Cordasco
parent 1f7539f6bf
commit 8352a09e32

View File

@ -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