Skip to content

Commit

Permalink
playbooks: os-lxc-container-setup: Force kill a container on openSUSE…
Browse files Browse the repository at this point in the history
… if it takes too long to stop

[This is identical to I02299cb17477f63970e11ce3c8455cb12773a541]

It appears that lxc-1.1.5 is very slow when stopping a container. As a
result of which we pass the timeout (-t) option on openSUSE whilst this
is being investigated on the distribution level. This can also be
removed when lxc-2.X.X becomes the default option on openSUSE.

Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1054609
Change-Id: Id9ba9a716a115df2ef3e7755f7ba43cc566683c7
(cherry picked from commit 76e1d61)
  • Loading branch information
Markos Chandras committed Aug 31, 2017
1 parent 275b5e8 commit 4e6e87a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions playbooks/common-tasks/os-lxc-container-setup.yml
Expand Up @@ -91,11 +91,16 @@
# Due to https://github.com/ansible/ansible-modules-extras/issues/2691
# this uses the LXC CLI tools to ensure that we get logging.
# TODO(odyssey4me): revisit this once the bug is fixed and released
# NOTE(hwoarang): We pass the timeout (-t) option on openSUSE due to
# https://bugzilla.opensuse.org/show_bug.cgi?id=1054609. Feel free to
# remove this workaround when the bug is closed or lxc-2.X.X becomes the
# default on openSUSE.
- name: Lxc container restart
command: >
lxc-stop --name {{ inventory_hostname }}
--logfile {{ lxc_container_log_path }}/lxc-{{ inventory_hostname }}.log
--logpriority {{ (debug | bool) | ternary('DEBUG', 'INFO') }}
"{{ (hostvars[physical_host]['ansible_pkg_mgr'] == 'zypper') | ternary('-t 10', '') }}"
delegate_to: "{{ physical_host }}"
register: container_stop
until: container_stop | success
Expand Down

0 comments on commit 4e6e87a

Please sign in to comment.