Skip to content

Latest commit

 

History

84 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

svpb-ansible

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.

Dependencies

Please install the following dependencies:

  • vagrant
    • On a debian-based system: sudo apt install vagrant
  • 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

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.

Usage

  1. Clone this repo
  2. cd svpb-ansible
  3. vagrant 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 svpb from 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 -i to become user svpb
  • shutdown the VM with vagrant halt
  • start over with vagrant destroy & another run of vagrant up (delete the svpb directory if you do not want to keep your changes)
  • use vagrant-scp to copy files between host and guest
  • use vagrant provision to 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.

Using qemu instead of virtualbox

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 peculiarities

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)

About

Developer VM mirroring production setup

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages