From 5c5e903973a9db4541196fbe9fcb99ce66c5cfa4 Mon Sep 17 00:00:00 2001 From: Kuo-tung Kao Date: Wed, 13 Apr 2016 10:20:27 +0800 Subject: [PATCH] check /e/s/s/docker.service in ubuntu check "/etc/systemd/system/docker.service" instead of "/lib/systemd/system/docker.service" in ubuntu. In Ubuntu, the settings in "/etc/systemd/system/docker.service" will overwrite the settings in "/lib/systemd/system/docker.service" Change-Id: Idd5b99643b4fb9a4800f5d450e9aaeb22210aa8b Closes-Bug: #1569644 --- ansible/roles/prechecks/tasks/service_checks.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ansible/roles/prechecks/tasks/service_checks.yml b/ansible/roles/prechecks/tasks/service_checks.yml index 14aed9904d..233b79e09a 100644 --- a/ansible/roles/prechecks/tasks/service_checks.yml +++ b/ansible/roles/prechecks/tasks/service_checks.yml @@ -12,7 +12,7 @@ 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' +- name: Checking if 'MountFlags' in /lib/systemd/system/docker.service is set to 'shared' in RedHat family command: cat /lib/systemd/system/docker.service register: result changed_when: false @@ -22,7 +22,17 @@ 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 'MountFlags' in /etc/systemd/system/docker.service is set to 'shared' in Ubuntu + command: cat /etc/systemd/system/docker.service + register: result + changed_when: false + 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_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