Ignore docker service errors 46/62646/7
authorThanh Ha <zxiiro@gmail.com>
Tue, 17 Dec 2019 17:12:06 +0000 (12:12 -0500)
committerThanh Ha (zxiiro) <zxiiro@gmail.com>
Mon, 16 Mar 2020 21:24:28 +0000 (21:24 +0000)
The docker_service_enable switch was a hacky workaround to allow
molecule to be able to run the docker role. Rather than introducing
a variable that is not used anywhere an alternative is to just
ignore the error from the service enable command.

This command is expected to pass in VMs but fail in docker containers
due to missing systemctl. It is not critical that the service is
enabled so this is a reasonable alternative to using an otherwise
unused variable.

Change-Id: I25984ca2fd5e6141b29a23cb5feb4d1283eddd1a
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
defaults/main.yml
molecule/default/molecule.yml
tasks/main.yml

index 57267f0..32f2a3a 100644 (file)
@@ -1,5 +1,4 @@
 ---
-docker_service_enable: true
 mtu: 1500
 docker_ce_name: docker-ce
 docker_repo_channel: stable
index 231c8de..05b5dcb 100644 (file)
@@ -27,8 +27,6 @@ provisioner:
   name: ansible
   inventory:
     group_vars:
-      centos:
-        docker_service_enable: false
       centos_version:
         centos_docker_version: 18.06.1.ce
       ubuntu_version:
index 15f021f..5137160 100644 (file)
 
 - name: Enable Docker service
   service: name=docker enabled=true
-  when: docker_service_enable
+  ignore_errors: true
   become: true