From 42efd9a75ec011202797a7005280f5ceaf39c578 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Tue, 17 Dec 2019 12:12:06 -0500 Subject: [PATCH] Ignore docker service errors 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 --- defaults/main.yml | 1 - molecule/default/molecule.yml | 2 -- tasks/main.yml | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 57267f0..32f2a3a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,4 @@ --- -docker_service_enable: true mtu: 1500 docker_ce_name: docker-ce docker_repo_channel: stable diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 231c8de..05b5dcb 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -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: diff --git a/tasks/main.yml b/tasks/main.yml index 15f021f..5137160 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -112,5 +112,5 @@ - name: Enable Docker service service: name=docker enabled=true - when: docker_service_enable + ignore_errors: true become: true -- 2.16.6