davestephens / ansible-nas

Build a full-featured home server or NAS replacement with an Ubuntu box and this playbook.
MIT License
3.23k stars 490 forks source link

Playbook doesn't seem to be able to set up docker startup correctly on fresh install (Ubuntu LTS 20.04) #481

Closed CaliLuke closed 3 years ago

CaliLuke commented 3 years ago

Describe the bug

I'm running the playbook to install the nas on a fairly fresh install of Ubuntu 20.04 and the playbook stops with an error at "ensure docker is started and enabled at boot".

The error thrown is

"Unable to start service docker: Job for docker.service failed because the control process exited with error code.\nSee \"systemctl status docker.service\" and \"journalctl -xe\"

Environment

all.yml Variables

Expected behavior

installation should be successful

Actual behavior

installation stops with the error I reported above.

Steps to reproduce

just run the ansible playbook with the sytnax from the installation guide.

Playbook Output

task path: /home/luca/.ansible/roles/geerlingguy.docker/tasks/main.yml:14
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: luca
<localhost> EXEC /bin/sh -c 'echo ~luca && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/luca/.ansible/tmp/ansible-tmp-1630301122.383374-4642257519819 `" && echo ansible-tmp-1630301122.383374-4642257519819="` echo /home/luca/.ansible/tmp/ansible-tmp-1630301122.383374-4642257519819 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/system/systemd.py
<localhost> PUT /home/luca/.ansible/tmp/ansible-local-3945338htgzdtf9/tmprisrqw77 TO /home/luca/.ansible/tmp/ansible-tmp-1630301122.383374-4642257519819/AnsiballZ_systemd.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/luca/.ansible/tmp/ansible-tmp-1630301122.383374-4642257519819/ /home/luca/.ansible/tmp/ansible-tmp-1630301122.383374-4642257519819/AnsiballZ_systemd.py && sleep 0'
<localhost> EXEC /bin/sh -c 'sudo -H -S  -p "[sudo via ansible, key=xxhlxbgvonucwfmsrzdsvpvzbckuaxpz] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-xxhlxbgvonucwfmsrzdsvpvzbckuaxpz ; /usr/bin/python3 /home/luca/.ansible/tmp/ansible-tmp-1630301122.383374-4642257519819/AnsiballZ_systemd.py'"'"' && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/luca/.ansible/tmp/ansible-tmp-1630301122.383374-4642257519819/ > /dev/null 2>&1 && sleep 0'
fatal: [ansible_nas]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "daemon_reexec": false,
            "daemon_reload": false,
            "enabled": true,
            "force": null,
            "masked": null,
            "name": "docker",
            "no_block": false,
            "scope": null,
            "state": "started",
            "user": null
        }
    },
    "msg": "Unable to start service docker: Job for docker.service failed because the control process exited with error code.\nSee \"systemctl status docker.service\" and \"journalctl -xe\" for details.\n"
}

Additional context n/a

davestephens commented 3 years ago

This is the giveaway from your logs:

Aug 29 22:25:27 borg dockerd[3946974]: time="2021-08-29T22:25:27.112165226-07:00" level=error msg="failed to mount overlay: invalid argument" storage-driver=overlay2
Aug 29 22:25:27 borg dockerd[3946974]: failed to start daemon: error initializing graphdriver: driver not supported

Check out the variables in https://github.com/davestephens/ansible-nas/blob/master/roles/ansible-nas-docker/defaults/main.yml and override the storage driver to match your file system.

CaliLuke commented 3 years ago

makes sense. when you say "override" you mean in

a: inventories/my-ansible-nas/group_vars/nas.yml

or in

b: roles/ansible-nas-docker/defaults/main.yml

?

in any case I changed it to

---
ansible_nas_user: david

# Where you want Docker to store its container data.
docker_home: /mnt/Volume2/docker

# Where you want Docker to store images
docker_image_directory: "{{ docker_home }}/data"

# Docker storage driver, see https://docs.docker.com/storage/storagedriver/select-storage-driver/#supported-backing-filesystems
# You might want to change this to ZFS, depending on your underlying filesystem.
docker_storage_driver: ZFS

but the script threw the same error which makes me think I either put the wrong keyword in the storage driver or overrode it in the wrong place. Thanks in advance for your help.