WSL2: Failing to check docker daemon status
janorn opened this issue · 7 comments
janorn commented
Version Information
Ansible: 2.9.6
Role: 3.1.0
Steps to Reproduce
Using this role in Ubuntu 20.04 in WSL2 (Windows Subsystem for Linux)
Expected Behavior
Ansible run finish correctly
Actual Behavior
TASK [haxorof.docker_ce : Setup Docker environment file /etc/default/docker] *******************************************
ok: [127.0.0.1]
TASK [haxorof.docker_ce : Ensure /etc/docker directory exists] *********************************************************
ok: [127.0.0.1]
TASK [haxorof.docker_ce : Configure Docker daemon (file)] **************************************************************
skipping: [127.0.0.1]
TASK [haxorof.docker_ce : Fetch Docker daemon status] ******************************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "one of the following is required: state, enabled"}
PLAY RECAP *************************************************************************************************************
127.0.0.1 : ok=34 changed=0 unreachable=0 failed=1 skipped=26 rescued=0 ignored=0
References
janorn commented
WSL2 doesnt support systemd.
janorn commented
Perhaps use:
- name: Check service state
service_facts:
- name: Docker service state
debug:
var: ansible_facts.services['docker']
haxorof commented
Thanks for reporting this. Will see if I get some time to look into it this weekend.
Cheers!
haxorof commented
Thanks for the PR but I took most of what you did in the PR and improved the things I mentioned. Will reject the PRs and push my changes.
janorn commented
Been busy so I didn't have time to look at it.
haxorof commented
Been busy so I didn't have time to look at it.
No worries, here too but got a slot yesterday and ran through all regression tests. Please try the new version I just released and hope that will work in WSL2 now. 😊
janorn commented
I tried the new code and it works! Thanks.