nephio-experimental/one-summit-22-workshop

add fix to docker install ansible task to ignore errors when docker service check is performed

Closed this issue · 0 comments

Currently, the task for docker install attempts to first check (https://github.com/nephio-project/one-summit-22-workshop/blob/main/nephio-ansible-install/roles/docker/tasks/main.yaml#L6) if docker service is already installed. On a fresh OS install, the command to check if docker service is installed fails causing the ansible task to fail and exit. The behavior should be altered to ignore the error on a fresh OS install and proceed with docker install.
The error currently being displayed is below

(.venv) jbelamaric@nephio-ansible:~/one-summit-22-workshop/nephio-ansible-install$ ansible-playbook playbooks/install-prereq.yaml

PLAY [vm] *****************************************************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************************************
ok: [10.128.0.23]

TASK [install packages] ***************************************************************************************************************************
ok: [10.128.0.23]

TASK [docker : check if docker already installed] *************************************************************************************************
fatal: [10.128.0.23]: FAILED! => {"changed": true, "cmd": "service docker status", "delta": "0:00:00.012636", "end": "2023-01-27 22:01:40.631296", "msg": "non-zero return code", "rc": 4, "start": "2023-01-27 22:01:40.618660", "stderr": "Unit docker.service could not be found.", "stderr_lines": ["Unit docker.service could not be found."], "stdout": "", "stdout_lines": []}

PLAY RECAP ****************************************************************************************************************************************
10.128.0.23                : ok=2    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0