From: Thanh Ha Date: Tue, 11 Sep 2018 20:21:19 +0000 (-0400) Subject: Add molecule testing for CentOS machines X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=5df1ffd0496636ce169ef5bb6b18ab665174d50d;p=ansible%2Froles%2Fdocker-install.git Add molecule testing for CentOS machines Add the systemd workaround for CentOS systems so that we can enable molecule testing. Change-Id: I3cdeb4b386f8c2ea4183be0423fd7b5daf3ebda2 Signed-off-by: Thanh Ha --- diff --git a/defaults/main.yml b/defaults/main.yml index a37d6a8..0d34070 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,3 @@ --- +docker_service_enable: true mtu: 1500 diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 3423388..feddd52 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -6,14 +6,18 @@ driver: lint: name: yamllint platforms: - # Disable centos7 tests until we figure out how to get systemctl working - # in a Docker container reliabily. - # - name: centos7 - # image: centos:7 + - name: centos7 + image: centos:7 + groups: + - centos - name: ubuntu1604 image: ubuntu:16.04 provisioner: name: ansible + inventory: + group_vars: + centos: + docker_service_enable: false lint: name: ansible-lint scenario: diff --git a/tasks/main.yml b/tasks/main.yml index a952365..dc87459 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -67,4 +67,5 @@ - name: Enable Docker service service: name=docker enabled=true + when: docker_service_enable become: true