From 958efcef73fe1bb4de7bc65b1535a0fefc6e7771 Mon Sep 17 00:00:00 2001 From: Gary Perkins Date: Fri, 8 Mar 2019 18:28:57 +0000 Subject: [PATCH] Fix Neutron precheck to not fail with newer Docker With newer Docker versions `systemctl show docker` returns: MountFlags=shared Instead of: MountFlags=1048576 This fix accepts either value as valid to ensure the check is not erroneously failing. Closes-Bug: #1791365 Change-Id: I2bd626466d6a0e189e0d85877b2be8f2b4bb37f4 --- ansible/roles/neutron/tasks/precheck.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ansible/roles/neutron/tasks/precheck.yml b/ansible/roles/neutron/tasks/precheck.yml index a0a1c7f319..19ecdab411 100644 --- a/ansible/roles/neutron/tasks/precheck.yml +++ b/ansible/roles/neutron/tasks/precheck.yml @@ -27,11 +27,14 @@ # When MountFlags is set to shared, a signal bit configured on 20th bit of a number # We need to check the 20th bit. 2^20 = 1048576. So we are validating against it. +# In some systems MountFlags on the Docker service is set to 'shared', whereas +# in others it's set to the decimal value of the 20th bit. This now checks for both +# values. Either '1048576' or 'shared' will pass the precheck. - name: Checking if 'MountFlags' for docker service is set to 'shared' command: systemctl show docker register: result changed_when: false - failed_when: result.stdout.find('MountFlags=1048576') == -1 + failed_when: result.stdout.find('MountFlags=1048576') == -1 and result.stdout.find('MountFlags=shared') == -1 when: - (inventory_hostname in groups['neutron-dhcp-agent'] or inventory_hostname in groups['neutron-l3-agent']