Commit 96e6d21b authored by Nick Busey's avatar Nick Busey

#77 Fix for vagrant testing

parent cf31d4bc
Pipeline #43052917 passed with stages
in 38 seconds
...@@ -39,7 +39,7 @@ restore: logo ...@@ -39,7 +39,7 @@ restore: logo
# Spin up a development stack # Spin up a development stack
develop: logo develop: logo
vagrant plugin install vagrant-disksize #vagrant plugin install vagrant-disksize
vagrant up vagrant up
vagrant provision vagrant provision
......
...@@ -120,7 +120,16 @@ Please do! ...@@ -120,7 +120,16 @@ Please do!
### Developing Locally ### Developing Locally
Run `make develop` to spin up a local instance inside a Vagrant machine. If you make changes to the Ansible scripts you can run `make provision` to run them again. You can play around with the stack locally without needing an actual server to spin it up against.
First run `make config` as normal. The local IP and SSH username are not used for Vagrant, so they can be
for your real server, or fake. For `What is the domain you have pointed at your Homelab server with ports 80 and 443?:`
enter `localhost`.
Now run `make develop` to spin up a local instance inside a Vagrant machine.
For easy access to the services run `vagrant ssh -c "cat /var/homelabos/homelab_hosts"`. Append the output of this to your
machine's host file (usually `/etc/hosts`). Now you should be able to access http://servicename.localhost:2280/ for any services
you have enabled in `config.yml`.
If you make changes to the Ansible scripts you can run `make provision` to run them again.
### Working locally on the documentation ### Working locally on the documentation
...@@ -128,4 +137,4 @@ Follow the [MkDocs Material Theme setup directions](https://squidfunk.github.io/ ...@@ -128,4 +137,4 @@ Follow the [MkDocs Material Theme setup directions](https://squidfunk.github.io/
Then run `mkdocs serve`. Then run `mkdocs serve`.
To build changes to the docs run `make docs`. To build changes to the docs run `make docs`.
\ No newline at end of file
...@@ -7,12 +7,16 @@ Vagrant.configure(2) do |config| ...@@ -7,12 +7,16 @@ Vagrant.configure(2) do |config|
config.ssh.insert_key = false config.ssh.insert_key = false
config.vm.network "forwarded_port", id: "http", guest: 80, host: 2280, auto_correct: true
config.vm.network "forwarded_port", id: "https", guest: 443, host: 2281, auto_correct: true
config.vm.network "forwarded_port", id: "traefik-dashboard", guest: 8181, host: 2282, auto_correct: true
config.vm.provision "ansible" do |ansible| config.vm.provision "ansible" do |ansible|
ansible.playbook = "homelabos.yml" ansible.playbook = "homelabos.yml"
ansible.groups = { "homelabos" => ["default"] } ansible.groups = {
ansible.extra_vars = { ansible_ssh_user: 'vagrant', "homelabos" => ["default"],
ansible_python_interpreter:"/usr/bin/python3", "vagrant" => ["default"],
ansible_connection: 'ssh', }
ansible_ssh_args: '-o ForwardAgent=yes'} ansible.extra_vars = 'config.yml'
end end
end end
# These are the defaults. They are overridden by values in your config.yml file. # These are the defaults. They are overridden by values in your config.yml file.
common_timezone: Etc/UTC common_timezone: Etc/UTC
domain: localhost
admin_email: test@test.com
enable_tinc: False enable_tinc: False
enable_tor: False enable_tor: False
......
ansible_ssh_user: 'vagrant'
ansible_python_interpreter: "/usr/bin/python3"
ansible_connection: 'ssh'
ansible_ssh_args: '-o ForwardAgent=yes'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment