Tips to Help You Troubleshoot Your VM
- Have you checked the log from the beginning of “vagrant up”? Did all tasks execute?
- Does your vagrantfile correctly assign permissions for the folder shared between your machine and the vm?
- Sometimes apt updates fails because the server isn’t responding at that moment
- Is your file in the correct subdirectory?
- Is your shell or command not executing as expected?
- It may be because Ansible doesn’t call bash but rather sh and does it non-interactively — meaning what your bash dotfiles do, doesn’t happen, including setting of the PATH environment variable
- Did you accidentally name a results variable the same as a results variable in a previous task?
- What’s appropriate for the task? Root or [username]? What is the task using?
- If you’re stuck, try the debug Ansible module
- If you’re stuck at the beginning, try commenting out successive playbooks and just get the first one working, then first and second, and so forth.
- Be careful of quotes and Ansible variables — use “{{ variable_name }}” in your Ansible statements for best practices (see YAML Syntax).
- Are your indentations spaces, not tabs, in your editor?
- Although the three dashes at the beginning of the yaml file are optional for Ansible, they’ll help editors recognize the file as a yaml. Did you accidentally whack them?