diff --git a/README.md b/README.md index d56b472..2eddd2f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Testing This repository comes with a test-ready setup to try out the complete site setup locally. -It uses vagrant to accomplish this and create a pretend target host. +It uses vagrant to accomplish this and create a locally available target host. Install [vagrant](https://www.vagrantup.com/) on your system and to make tests repeatable also install the vagrant plugins `vagrant-hosts` and `vagrant-hostsupdater`, which will set a static IP for the vagrant host to be reachable under. @@ -11,6 +11,22 @@ which will set a static IP for the vagrant host to be reachable under. vagrant plugin install vagrant-hosts vagrant-hostsupdater ``` +Additionally, since the test setup mirrors the production setup in that it makes use of subdomains for the individual hosted applications, +the server needs to be reachable under a domain name, +not just an IP address. +For now this is most simply accomplished through editing the hosts file, e.g.: + +```hosts +192.168.56.2 ansible.test +192.168.56.2 git.ansible.test +192.168.56.2 links.ansible.test +``` + +This will allow you to reach the main domain under `http(s)://ansible.test` and sets up two subdomains that can be reached. +Be aware that the hosts file does not support subdomain wildcards. +You will have to specify each hostname individually or use a tool such as `dnsmasq`. +Read more [here](https://serverfault.com/questions/118378/in-my-etc-hosts-file-on-linux-osx-how-do-i-do-a-wildcard-subdomain). + Then you are ready to run the complete infrastructure setup locally, simply by executing `ansible-playbook site.yml`. You can of course pick and choose what should be executed with host limits, tags, group variables, and so on, diff --git a/Vagrantfile b/Vagrantfile index e990fd0..c5c287a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,11 +1,14 @@ Vagrant.configure('2') do |config| config.vm.define 'tau' do |debian| debian.vm.box = 'bento/ubuntu-20.04' - debian.vm.network :private_network, ip: '192.168.27.2' + debian.vm.network :private_network, ip: '192.168.56.2' debian.vm.hostname = 'tau' debian.vm.provider 'virtualbox' do |vb| vb.memory = '2048' vb.cpus = 2 end + debian.vm.provision :hosts do |provisioner| + provisioner.add_host '192.168.56.2', ['ansible.test'] + end end end diff --git a/group_vars/testing.yml b/group_vars/testing.yml index 8a87318..13676f5 100644 --- a/group_vars/testing.yml +++ b/group_vars/testing.yml @@ -5,16 +5,17 @@ docker_swarm_advertise_addr: eth1 caddy_use_debug: yes caddy_tls_use_staging: yes +blog_use_https: no caddy_use_https: no -whoami_use_https: no -wallabag_use_https: no +gitea_use_https: no +landingpage_use_https: no miniflux_use_https: no -searx_use_https: no -traggo_use_https: no monica_use_https: no nextcloud_use_https: no +searx_use_https: no shaarli_use_https: no -landingpage_use_https: no -blog_use_https: no +traggo_use_https: no +wallabag_use_https: no +whoami_use_https: no -#server_domain: mytest.com +server_domain: ansible.test diff --git a/host_vars/tau.yml b/host_vars/tau.yml index c50dd60..c5f2d85 100644 --- a/host_vars/tau.yml +++ b/host_vars/tau.yml @@ -1,5 +1,5 @@ --- -ansible_host: 192.168.27.2 +ansible_host: 192.168.56.2 ansible_ssh_user: vagrant ansible_ssh_private_key_file: "{{ playbook_dir }}/.vagrant/machines/tau/virtualbox/private_key"