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/.
- 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.
- 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
- Not all branches of possible errors have been tested. See flowchart in the associated tutorial.
- Sometimes getting the apt updates fail, probably because that server isn’t responding at that moment
- Did you accidentally wack the three dashes at the beginning of the file?
- If your file isn’t evaluated -- is it in the correct subdirectory?
- Be careful of quotes and Ansible variables
- 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?
- Are you root or [username] as appropriate for the task?
- If you’re stuck, try the debug module
- Vagrant running Ansible defaults to the "root" user, but "Become: true" is needed for some tasks to make sure they're run as root
- Make sure to Use become/become_user (see Ansible docs) as needed for non-root users
-
For a complete Vagrant reference, please see the online documentation at https://docs.vagrantup.com.
-
Every Vagrant development environment requires a box. If you want to switch out the box used here, you can search for other boxes at https://vagrantcloud.com/search.
-
Getting started: https://www.vagrantup.com/intro/getting-started/
-
Guide on using Ansible: https://www.vagrantup.com/docs/provisioning/ansible.html
-
Ansible's guide on using Vagrant: https://docs.ansible.com/ansible/latest/scenario_guides/guide_vagrant.html
-
Github's Ansible issues: https://github.com/ansible/ansible-modules-core/issues/
- At https://rvm.io
- Official RVM Ansible tutorial: https://github.com/rvm/rvm1-ansible
- The How-To Forge tutorial at https://www.howtoforge.com/tutorial/ubuntu-ruby-on-rails/