diff --git a/Vagrantfile b/Vagrantfile index d7908406295e5c91e89efd50864911a1e9e74776..0a03b2c860c12486a0f59a5975dc4e9d55be5729 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -44,6 +44,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| core.vm.network :private_network, ip: "#{BASE_IP_ADDR}.#{i+1}" core.vm.synced_folder ".", "/data/infrastructure", id: "coreos-infrastructure", :nfs => true, :mount_options => ['nolock,vers=3,udp'] core.vm.provision :file, source: "./cloud-config", destination: "/tmp/vagrantfile-user-data" + core.vm.provision :shell, inline: "cp /data/infrastructure/scripts/unsecure-certs/*.pem /data/server-wide/haproxy/approved-certs" core.vm.provision :shell, path: "./scripts/setup.sh" core.vm.provision :shell, inline: "etcdctl set /services/default '{\"app\":\"nginx\", \"hostname\":\"#{HOSTNAME}\"}'" core.vm.provision :shell, path: "./scripts/approve-user.sh", args: [HOSTNAME, "nginx"] diff --git a/scripts/setup.sh b/scripts/setup.sh index 175d22cdb40b2fbe4df00b0c995059ee0dd1526e..bed787010f475ca2b791f07dccd36b05f37c8e6f 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -15,8 +15,10 @@ docker pull indiehosters/mysql docker pull indiehosters/wordpress docker pull indiehosters/nginx +# Activate default domain +etcdctl set /services/default '{"app":"nginx", "hostname":"`hostname`"}' + # Configure and start HAproxy mkdir -p /data/server-wide/haproxy/approved-certs -cp /data/infrastructure/scripts/unsecure-certs/*.pem /data/server-wide/haproxy/approved-certs systemctl enable haproxy.service systemctl start haproxy.service