From 7c5e4384e0be866432c64789eed3813c8ba1d210 Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: May 25 2020 01:41:45 +0000 Subject: Update Vagrant setuo so it works Signed-off-by: Ryan Lerch --- diff --git a/.gitignore b/.gitignore index b8bb54d..aae954a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ dist/ alembic.ini .vagrant/ .tox/ +client_secrets.json +config diff --git a/README.md b/README.md index 325ada6..9591820 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ with `vagrant ssh` and run the command to start the Fedora Elections server: ``` vagrant ssh -[vagrant@localhost ~]$ pushd /vagrant/; ./runserver.py --host "0.0.0.0"; +[vagrant@localhost ~]$ pushd /vagrant/; python runserver.py -c config --host "0.0.0.0"; ``` Once that is running, go to [localhost:5005](http://localhost:5005/) in your diff --git a/Vagrantfile b/Vagrantfile index e72dbf8..4799255 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,12 +1,28 @@ # -*- mode: ruby -*- # vi: set ft=ruby : +$script = <<-SCRIPT +pushd /vagrant; +dnf -y install python redhat-rpm-config python-devel python-pip rpl gcc +pip install -r /vagrant/requirements.txt +rm -f config +rm -f client_secrets.json +oidc-register https://iddev.fedorainfracloud.org/ http://localhost:5005/oidc_callback +echo 'OIDC_ID_TOKEN_COOKIE_SECURE = False' > config +echo 'OIDC_REQUIRE_VERIFIED_EMAIL = False' >> config +SCRIPT + Vagrant.configure(2) do |config| - config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-libvirt.box" - config.vm.box = "f23-cloud-libvirt" - config.vm.network "forwarded_port", guest: 5000, host: 5002 - config.vm.synced_folder ".", "/vagrant", type: "sshfs" - config.vm.provision "shell", inline: "dnf -y install python redhat-rpm-config python-devel python-pip rpl" - config.vm.provision "shell", inline: "pushd /vagrant/; pip install -r requirements.txt" - config.vm.provision "shell", inline: "pushd /vagrant/; python createdb.py", privileged: false + config.vm.define :elections do |elections| + elections.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/32/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-32-1.6.x86_64.vagrant-libvirt.box" + elections.vm.box = "f32-cloud-libvirt" + elections.vm.provider :libvirt do |libvirt| + libvirt.cpus = 2 + libvirt.memory = 2048 + end + elections.vm.network "forwarded_port", guest: 5005, host: 5005 + elections.vm.synced_folder ".", "/vagrant", type: "sshfs" + elections.vm.provision "shell", inline: $script + elections.vm.provision "shell", inline: "pushd /vagrant/; python createdb.py", privileged: false + end end