Skip to content

Troubleshooting

Common problems with the Ansible instance, what causes them and how to fix them.

Permission denied when a task writes a system file

Cause: privilege escalation is off, so tasks run as the user who started the playbook.

Fix: run with --become, or set become: true on the task, see Run tasks as root.

Permission denied reading the vault password

Cause: /etc/ansible/vault-password is readable by root only.

Fix: run the vault command with sudo, see Use Ansible Vault.

Host key verification failed

Cause: host key checking is on, and the remote host's key is not in ~/.ssh/known_hosts.

Fix: connect once with ssh, verify the key, then run the playbook again. Do not turn host key checking off.

Remote hosts fail with a missing Python interpreter

Cause: ansible.cfg sets interpreter_python to this instance's virtual environment, /opt/ansible-core/venv/bin/python, which does not exist on other machines.

Fix: set ansible_python_interpreter for remote hosts in the inventory, see Manage remote hosts.

ansible-inventory --sushi-check-local or the walkthrough fails

Cause: the inventory now contains more than the local host. That check is for the default, localhost-only setup.

Fix: nothing to fix if you added hosts on purpose. Use ansible-inventory --list to review your inventory.

A module or collection is not found

Cause: only ansible.posix and ansible.utils are installed besides the built-in modules. amazon.aws, for example, is not.

Fix: install the collection, see Add collections.

The configuration or inventory is missing

Cause: the first-boot service has not finished, or it failed.

Fix: wait for it, then check its status and retry if needed:

cloud-init status --wait
systemctl status sushi-ansible-core-firstboot
sudo systemctl restart sushi-ansible-core-firstboot

If it still fails, contact info@softwaresushi.com.