Install using Ansible

Deployment is done via Ansible. Currently, only single server deployments are described but you can just as easily deploy the application in a Kubernetes environment.

Warning

The deployment configuration (called a “playbook”) is very simplistic and also contains sensitive values. This makes the playbook more readable but is not following best practices!

Prerequisites

You will only need Ansible tooling and nothing more on your own machine:

Server preparation

You can configure the Ansible playbook to install relevant services, do it manually, or have these pre-installed. You will need:

  • PostgreSQL 10 or above

  • Nginx

  • Docker

  • Python 3.6+ (needed for Ansible, not Open Forms)

  • Python PIP

Apart from Docker, you can install all these with something like:

$ sudo apt-get install git postgresql nginx python3 python3-pip python3-venv

For Docker, follow the instructions here: https://docs.docker.com/engine/install/

You will also need access to, or create, a database. You can create a database with something like:

$  sudo su postgres --command="createuser <db-username> -P"
Enter password for new role:
Enter it again:
$ sudo su postgres --command="createdb <db-name> --owner=<db-username>"

Installation

  1. Download the project from Github or just the deployment files.

    $ git clone https://github.com/open-formulieren/open-forms.git
    
  2. Setup virtual environment:

    $ python3 -m venv env/
    $ source env/bin/activate
    $ pip install "ansible~=2.10"
    

    Note

    Sometimes, additional or updates packages are needed if they are not installed by the Ansible setup installation. You can do so like this:

    $ python -m pip install -U pip
    $ pip install ordered_set packaging appdirs six wheel
    
  3. Install Ansible collections:

    $ ansible-galaxy collection install community.docker
    $ ansible-galaxy collection install maykinmedia.commonground
    
  4. Edit the playbook app.yml to match your setup. Take special note of all TODO settings and read through all the comments and variables.

  5. Rename hosts.example to hosts and make sure it contains your host.

  6. Run the playbook:

    $ ansible-playbook app.yml [--become --ask-become-pass --user=<myusername>]