This repo contains the files necessary to setup a developer VM for the svpb django webapp. It strives to mirror the production server as close as possible. Thus, the ansible playbook also serves as a guideline how to setup the production server.
Please install the following dependencies:
- vagrant
- On a debian-based system:
sudo apt install vagrant
- On a debian-based system:
- Vagrant relies on a virtualisation software being installed. virtualbox is recommended. See below for an alternative (qemu).
- If you want to move files between guest and host, install the plugin
vagrant-scp with
vagrant plugin install vagrant-scp - git
- On a debian-based system:
sudo apt install git
- On a debian-based system:
Only if you want to push changes to GitHub:
- Configure your GitHub account: To be able to push changes, you either have to generate and add an SSH key or setup a personal access token in your account. "Password-based authentication for Git has been removed in favor of more secure authentication methods." (quoted from here), i.e. you cannot use the password you login to the GitHub website with.
- Clone this repo
cd svpb-ansiblevagrant up
This automatically runs every step required to get a working VM.
Now you can
- access the webapp via http://127.0.0.1:8888
- edit the content of the directory
svpbfrom your host system, it's a synced directory and mirrors the content of/home/svpb/svpb. - connect to the VM with
vagrant ssh- this logs you in as user vagrant, run
sudo -u svpb -ito become user svpb
- this logs you in as user vagrant, run
- shutdown the VM with
vagrant halt - start over with
vagrant destroy& another run ofvagrant up(delete thesvpbdirectory if you do not want to keep your changes) - use
vagrant-scpto copy files between host and guest - use
vagrant provisionto run the ansible playbook again
Ensure you are inside this directory (where the Vagrantfile is located) when calling vagrant commands, else it doesn't know which VM to control.
Feel free to poke around and destroy everything, starting over just takes a couple of minutes.
If it is not possible to use virtualbox (e.g. due to problems with the installation of virtualbox on debian bookworm), you can use libvirt in connection with qemu.
sudo apt install vagrant-libvirt libvirt-daemon-system qemu-system-x86
sudo usermod -a -G libvirt <YOUR USERNAME>
AlmaLinux has some peculiarities compared to e.g. Debian. Some are listed below for anyone interested in diving into AlmaLinux.
- Older default python version which might be EOL
- Note that security updates are still provided by RedHat (longer than by official Python devs)
- Many Django packages drop support for EOL versions, so we additionally install a specific python version if necessary
- Concept of modules (different versions of the same package installable via package manager, e.g. nginx)
- Not-so-nice texlive packages (incomplete and fine-grained, i.e. on package level instead of collections like texlive-science found on other systems)