Virtual Machine deployment using Ansible

Video Guide

A video walkthrough covering the steps in this guide is available at the bottom of this page.

To deploy the Security Server using Ansible, first clone the X-Road Git repository, checkout to 7.8.0 tag and go to the ansible folder

cd path/to/working/directory

git clone https://github.com/nordic-institute/X-Road.git
git checkout 7.8.0

cd ./ansible

In that folder, we need to create the following hosts file:

../ansible/hosts/hosts.txt

[ss_servers]
${VM-IP-ADDRESS} ansible_ssh_user=${VM-USER}

[example:children]
ss_servers

[ss_servers:vars]
variant=vanilla

Where:

  • VM-IP-ADDRESS - the virtual machine’s IP address and SSH port if it’s not the default.
  • VM-USER - the user on the virtual machine with sudo access, or root.

X-Road distributions support a setup where the database is installed on the same machine as the server, which we do not recommend, even for testing environments. Instead, specify a remote database instance in the Security Server variable file. Here is an example configuration:

Please make sure that PostgreSQL listens on the interface connected to the network (the default is localhost), and that pg_hba.conf is configured to accept requests from your network for all users.

../ansible/vars_files/ss_database.yaml

database_host: "127.0.0.1:5432"
database_admin_password: "superuser-password" ## password of postgres user

The database_admin_password should always be the password of the postgres user. The superuser is only used when setting up the database for the server and is not used by the server afterward.

After that, enable operational monitoring if it’s not already enabled:

../ansible/vars_files/base.yaml

xroad_install_opmonitoring: true

Lastly, deploy the Security Server using the following command:

ansible-playbook -i hosts/hosts.txt xroad_init.yml

Once deployed, follow the instructions in the X-Road Security Server Configuration Guide to continue the installation.

Video Guide

Below is a video walkthrough covering the steps described in this guide.