4.1.4. One application - multiple systems

This example automates the deployment of an application split into multiple systems.

It is intended for developers or system administrators who want to investigate on matters of performance or security in case of isolating the services in distinct systems.

The structure of interest looks like this:

../../_images/one_application_multiple_systems_1.png

Components of a service have their separate systems. The directed arrows represent connection requests that still expect responses.

In fact we use a certificate authority (CA) and an Ansible controller but do not want to blow up the number of VMs or containers. Thus we actually create a structure like this:

../../_images/one_application_multiple_systems_2.png

Ansible controller and CA are present as well

Incus has to be installed for this example - or the systems have to be created with another tool. It is used to generate db, app and web as containers and gui as VM:

$ bash inventories/test/generate_one_app_multi_systems_incus.sh

Log in to db:

$ incus shell db
# su debian
$ cd

First install the requirements as in the first example for Ubuntu but do not run any ansible-playbook command. Then install sshpass and generate the inventory:

$ sudo apt install -y sshpass
$ bash inventories/test/generate_one_app_multi_systems.sh

Now run the playbooks:

$ ansible-playbook playbooks/gnuhealth.yml -i inventories/test/one_app_multi_systems -e ansible_user=debian -e ansible_ssh_pass='debian' -e ansible_become_pass='debian'
$ ansible-playbook playbooks/desktop.yml -i inventories/test/one_app_multi_systems -e ansible_user=debian -e ansible_ssh_pass='debian' -e ansible_become_pass='debian'

Then run the client from gui and verify it is working:

$ incus console gui --type vga
  -> username: debian, password: debian
$ startx
  -> Run startx only if not seeing a GUI already
  -> Open client from applications -> office