Vagrant and VirtualBox (or some other VM provider) can be used to quickly build or rebuild virtual servers.
This Vagrant profile installsGogsusing theAnsibleprovisioner.
This README file is inside a folder that contains aVagrantfile
(hereafter this folder shall be called the [vagrant_root]), which tells Vagrant how to set up your virtual machine in VirtualBox.
To use the vagrant file, you will need to have done the following:
- Download and InstallVirtualBox
- Download and InstallVagrant
- InstallAnsible(guide for installing Ansible)
- Open a shell prompt (Terminal app on a Mac) and cd into the folder containing the
Vagrantfile
- Run the following command to install the necessary Ansible roles for this profile:
$ ansible-galaxy install -r requirements.yml
Once all of that is done, you can simply type invagrant up
,and Vagrant will create a new VM, install the base box, and configure it.
Once the new VM is up and running (aftervagrant up
is complete and you're back at the command prompt), you can log into it via SSH if you'd like by typing invagrant ssh
.Otherwise, the next steps are below.
You need to modify your host machine's hosts file (Mac/Linux:/etc/hosts
;Windows:%systemroot%\system32\drivers\etc\hosts
), adding the line below:
192.168.56.23 gogs
(Wheregogs
) is the hostname you have configured in theVagrantfile
).
After that is configured, you could visithttp://gogs:3000/install
in a browser, and you'll see the Gogs installation page. The MySQL root user account's password (configured inprovisioning/vars/main.yml
) isroot
.
If you'd like additional assistance editing your hosts file, please readHow do I modify my hosts file?from Rackspace.
Created in 2014 byJeff Geerling,author ofAnsible for DevOps.