diff --git a/playbooks/common-tasks/os-lxc-container-setup.yml b/playbooks/common-tasks/os-lxc-container-setup.yml index e776f3ed30..aa1ceac663 100644 --- a/playbooks/common-tasks/os-lxc-container-setup.yml +++ b/playbooks/common-tasks/os-lxc-container-setup.yml @@ -106,6 +106,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) tags: 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.