From 9438b2bf5681b8edba3777749fd47dc90ed24a20 Mon Sep 17 00:00:00 2001 From: Ryan Hallisey Date: Wed, 17 Feb 2016 03:46:04 -0500 Subject: [PATCH] Add a precheck for MountFlags=shared In order to avoid the neutron-dhcp-agent container from failing, you need to change 'MountFlags' to 'shared' in /var/lib/systemd/system/docker.serivce. Add a precheck so that this issue will not happen as often. Closes-bug: #1546681 Change-Id: I339b5e93e870534fe16c6610f299ca789e5ada62 --- .../roles/prechecks/tasks/service_checks.yml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ansible/roles/prechecks/tasks/service_checks.yml b/ansible/roles/prechecks/tasks/service_checks.yml index acd1524c09..8dcbda0fb9 100644 --- a/ansible/roles/prechecks/tasks/service_checks.yml +++ b/ansible/roles/prechecks/tasks/service_checks.yml @@ -10,3 +10,24 @@ register: result failed_when: result | failed or (result.stdout | from_yaml).Server.Version | regex_replace('(\\d+\\.\\d+\\.\\d+).*', '\\1') | version_compare(docker_version_min, '<') + +- name: Checking if 'MountFlags' in /lib/systemd/system/docker.service is set to 'shared' + command: cat /lib/systemd/system/docker.service + register: result + failed_when: result.stdout.find('MountFlags=shared') == -1 + when: + - (inventory_hostname in groups['neutron-dhcp-agent'] + or inventory_hostname in groups['neutron-l3-agent'] + or inventory_hostname in groups['neutron-metadata-agent']) + - ansible_os_family == 'RedHat' + or (ansible_distribution == 'Ubuntu' and ansible_distribution_version > '14.04') + +- name: Checking if '/run' mount flag is set to 'shared' + command: awk '$5 == "/run" {print $7}' /proc/self/mountinfo + register: result + failed_when: result.stdout.find('shared') == -1 + when: + - (inventory_hostname in groups['neutron-dhcp-agent'] + or inventory_hostname in groups['neutron-l3-agent'] + or inventory_hostname in groups['neutron-metadata-agent']) + - ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04'