Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
/ crj-vmrails Public archive

Vagrant-Ansible Ubuntu Virtual Machine for Ruby on Rails

Notifications You must be signed in to change notification settings

crjcodes/crj-vmrails

Repository files navigation

Purpose

Allows for the development and deployment and use of files that will build a Ubuntu virtual machine for a Ruby-on-Rails development platform using Ansible for the provisioning.

This project accompanies the tutorial available at https://codeonward.com/series/ubuntu-rails-vm-tutorial/.

Specs

  • Vagrant virtual machine hosted on a Windows 10 PC
  • Used in conjunction with Visual Studio Code and Git (Git for Bash optional)

See the Vagrantfile for details on port and ip specifications, shared folders, CPUs used, memory, and more.

Provisioning the Virtual Machine

  • OS and apt automatically updated when possible
  • APT as the mechanism to install (with a few exceptions to be updated)
  • Common tools include only bash, openssl, git, and curl as of this edit
  • Rvm is used as the RoR installer
  • Complex sections are in their own yml file
  • Pnly one ruby version installed by this script but more are easily added

Testing

  • Not all branches of possible errors have been tested. See flowchart in the associated tutorial.

A Beginner's Guide to Troubleshooting

  1. Sometimes getting the apt updates fail, probably because that server isn’t responding at that moment
  2. Did you accidentally wack the three dashes at the beginning of the file?
  3. If your file isn’t evaluated -- is it in the correct subdirectory?
  4. Be careful of quotes and Ansible variables
  5. 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
  6. Did you accidentally name a results variable the same as a results variable in a previous task?
  7. Are you root or [username] as appropriate for the task?
  8. If you’re stuck, try the debug module
  9. Vagrant running Ansible defaults to the "root" user, but "Become: true" is needed for some tasks to make sure they're run as root
  10. Make sure to Use become/become_user (see Ansible docs) as needed for non-root users

References

Vagrant References

Ansible References

RVM

About

Vagrant-Ansible Ubuntu Virtual Machine for Ruby on Rails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages