From 14f5c1402e4268b5940a5258814cb198dc8f3bda Mon Sep 17 00:00:00 2001
From: Manuel Buil <mbuil@suse.com>
Date: Wed, 29 Nov 2017 17:27:28 +0100
Subject: [PATCH] Make sure the docker service is started

We are installing the docker package but not checking if it is started

The service name for the three distros is the same but I still added the
variable in each distro variables file to keep best practices

Change-Id: I0c73069ea7edc366e824cf39d14d24d1416fd6c3
Signed-off-by: Manuel Buil <mbuil@suse.com>
---
 xci/playbooks/configure-opnfvhost.yml | 6 ++++++
 xci/var/Debian.yml                    | 1 +
 xci/var/RedHat.yml                    | 1 +
 xci/var/Suse.yml                      | 1 +
 4 files changed, 9 insertions(+)

diff --git a/xci/playbooks/configure-opnfvhost.yml b/xci/playbooks/configure-opnfvhost.yml
index fdf21786..58272ce6 100644
--- a/xci/playbooks/configure-opnfvhost.yml
+++ b/xci/playbooks/configure-opnfvhost.yml
@@ -158,6 +158,12 @@
       package:
         name: "{{ opnfv_required_packages }}"
         state: latest
+    # Docker is needed for functest
+    - name: Ensure Docker service is started and enabled
+      service:
+        name: "{{ docker_service_name }}"
+        state: started
+        enabled: yes
     - name: install opnfv required pip packages
       pip:
         name: "{{ opnfv_required_pip }}"
diff --git a/xci/var/Debian.yml b/xci/var/Debian.yml
index 16bb879b..bd07473a 100644
--- a/xci/var/Debian.yml
+++ b/xci/var/Debian.yml
@@ -11,3 +11,4 @@
 interface: "ens3"
 python_crypto_package_name: python-crypto
 docker_package_name: docker.io
+docker_service_name: docker
diff --git a/xci/var/RedHat.yml b/xci/var/RedHat.yml
index bcd6d044..8ea2e15a 100644
--- a/xci/var/RedHat.yml
+++ b/xci/var/RedHat.yml
@@ -10,3 +10,4 @@
 # this is placeholder and left blank intentionally to complete later on
 python_crypto_package_name: python-crypto
 docker_package_name: docker
+docker_service_name: docker
diff --git a/xci/var/Suse.yml b/xci/var/Suse.yml
index 6b4c76ec..a041e18b 100644
--- a/xci/var/Suse.yml
+++ b/xci/var/Suse.yml
@@ -11,3 +11,4 @@
 interface: "eth0"
 python_crypto_package_name: python-pycrypto
 docker_package_name: docker
+docker_service_name: docker
-- 
2.16.6