From 35d1415a22364ece46514b883370d6b750829630 Mon Sep 17 00:00:00 2001 From: Gaudenz Steinlin Date: Fri, 1 Dec 2017 21:10:39 +0100 Subject: [PATCH] Allow disabling container restarts Allow a deployer to disable container restarts by setting ``lxc_container_allow_restarts`` to ``false``. The tasks in common-tasks/os-lxc-container-setup.yml change some container options that require a restart to be effective. If these change during an upgrade this can cause uncoordinated LXC container restarts of galera or rabbitmq containers. This is a complement to the same option already present in the lxc_container_create role. Change-Id: Ib9b9daf816b0f62522997d2b0e66b6a5acd9a645 --- playbooks/common-tasks/os-lxc-container-setup.yml | 1 + ...container-restart-option-acf4cd9a20ef61e4.yaml | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 releasenotes/notes/add-lxc-container-restart-option-acf4cd9a20ef61e4.yaml diff --git a/playbooks/common-tasks/os-lxc-container-setup.yml b/playbooks/common-tasks/os-lxc-container-setup.yml index 920de9b805..bf6de694ec 100644 --- a/playbooks/common-tasks/os-lxc-container-setup.yml +++ b/playbooks/common-tasks/os-lxc-container-setup.yml @@ -113,6 +113,7 @@ until: container_stop | success retries: 3 when: + - lxc_container_allow_restarts | default(True) | bool - not is_metal | bool - (_mc is defined and _mc | changed) or (_ec is defined and _ec | changed) - _lxc_container_state.stdout.find('RUNNING') != -1 diff --git a/releasenotes/notes/add-lxc-container-restart-option-acf4cd9a20ef61e4.yaml b/releasenotes/notes/add-lxc-container-restart-option-acf4cd9a20ef61e4.yaml new file mode 100644 index 0000000000..d21ea6a051 --- /dev/null +++ b/releasenotes/notes/add-lxc-container-restart-option-acf4cd9a20ef61e4.yaml @@ -0,0 +1,15 @@ +--- +features: + - A new variable has been added to allow a deployer to control + the restart of containers from common-tasks/os-lxc-container-setup.yml. + This new option is ``lxc_container_allow_restarts`` and has a + default of ``true``. If a deployer wishes to disable the + auto-restart functionality they can set this value to ``false`` + and automatic container restarts will be disabled. + + This is a complement to the same option already present in the + lxc_container_create role. + + This option is useful to avoid uncoordinated restarts of galera + or rabbitmq containers if the LXC container configuration changes + in a way that requires a restart.