ahembree / ansible-hms-docker

Ansible playbook for automated home media server setup
GNU General Public License v3.0
402 stars 51 forks source link

Playbook fails during "ensuring hms-docker role" #21

Closed arthurdouillard closed 1 year ago

arthurdouillard commented 1 year ago

Hello, thanks for this repo!

I'm pretty noob to ansible & co, and the playbook crashes w/o giving me much information (even with -vvv).

TASK [Ensure HMS-Docker role] ****************************************************************************************************************************************************************************************
task path: /home/ubuntu/ansible-hms-docker/hms-docker.yml:21
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1681553216.6158442-12645315198404 `" && echo ansible-tmp-1681553216.6158442-12645315198404="` echo /root/.ansible/tmp/ansible-tmp-1681553216.6158442-12645315198404 `" ) && sleep 0'
Using module file /usr/lib/python3/dist-packages/ansible/modules/utilities/logic/import_role.py
<localhost> PUT /root/.ansible/tmp/ansible-local-30876cpcutv58/tmpm7m_ukh2 TO /root/.ansible/tmp/ansible-tmp-1681553216.6158442-12645315198404/AnsiballZ_import_role.py
<localhost> PUT /root/.ansible/tmp/ansible-local-30876cpcutv58/tmpuvspups9 TO /root/.ansible/tmp/ansible-tmp-1681553216.6158442-12645315198404/args
<localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1681553216.6158442-12645315198404/ /root/.ansible/tmp/ansible-tmp-1681553216.6158442-12645315198404/AnsiballZ_import_role.py /root/.ansible/tmp/ansible-tmp-1681553216.6158442-12645315198404/args && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1681553216.6158442-12645315198404/AnsiballZ_import_role.py /root/.ansible/tmp/ansible-tmp-1681553216.6158442-12645315198404/args && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1681553216.6158442-12645315198404/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 0
}

I'm on an Ubuntu server 20.04, fresh install, and filled all mandatory fields in the advanced config except VPN (do I really need a VPN for transmission?).

What can I do to fix that? Googling didn't help much.

Sorry if the question is stupid. Thanks again!

ahembree commented 1 year ago

Yes you need a VPN since I believe the transmission container requires it.

The verbose output you've provided doesn't seem to be outputting anything helpful other than "module failure" which I haven't seen before, so I'm not sure how to proceed. Can you try running with -vvvv or maybe even -vvvvv to get more verbose output?

Does the user you're running the Ansible command under have sudo/root privileges?

arthurdouillard commented 1 year ago

Thanks for the answer!

Yes you need a VPN since I believe the transmission container requires it.

Ok, I've setup a VPN then.

Does the user you're running the Ansible command under have sudo/root privileges?

Yes, I've given full root permission to the user I'm running the command from.

Can you try running with -vvvv or maybe even -vvvvv to get more verbose output?

This adds more logs to the tasks BUT the failing task, where I get the same unhelpful error message.

FYI, I've only modified the file ./vars/default.yml and nothing else. Am I doing something wrong?

ahembree commented 1 year ago

Hmmm it seems to be failing to import the role in general, it's not failing on a specific task within the role which is making it harder to narrow down.

Was Ansible installed to a virtualenv or anything? The only things I'm coming across online seem to point to python/Ansible installation issues

arthurdouillard commented 1 year ago

Ok that seemed to be the problem!

I've forced update ansible (sudo pip3 install ansible --upgrade) and now this steps works.

It seems my services are yet not up but that's probably a mistake of mine. I'll try to debug that.

Thank you for your swift and useful help!