4.1. GNU Health server and client in one system
This example is meant to be followed in an existing Virtual Machine (VM). It installs a GNU Health server and client on one system, running Ansible locally on the same system. This scenario is intended to be as easy as possible to create an instance for testing or developing.
If you want to install another server - e.g. Orthanc - you only have to call the corresponding playbook. Dependencies don’t differ.
Note for users without GNU/Linux experience: The following commands are meant to be executed in the terminal. Often you can open it using Ctrl+Alt+T. Copy & Paste inside a terminal has the shortcuts Ctrl+Shift+C & Ctrl+Shift+V, don’t forget the Shift. If using VirtualBox you should either open this instructions inside the VM or install Guest Additions for a shared clipboard.
4.1.1. Debian
The user performing the deployment needs sudo access. If you did not grant sudo access yet, run the following commands:
$ su -
# usermod -aG sudo <username>
# exit
Afterwards log out and log in again. Use the command groups to verify if it worked. Now follow the instructions for Ubuntu.
4.1.2. Ubuntu
Install the requirements:
$ sudo apt install pipx git
$ pipx ensurepath
$ source ~/.bashrc
$ pipx install ansible-core
$ ansible-galaxy collection install community.crypto community.general community.postgresql ansible.posix
Clone and enter this repository:
$ git clone https://codeberg.org/gnuhealth/ansible.git
$ cd ansible
Run the playbook:
$ ansible-playbook playbooks/gnuhealth_minimal.yml -i inventories/dev -c local -e ansible_user=`whoami` -K
You will get a prompt for the sudo/become password thanks to the -K flag.
You can run the client either using the desktop entry or from terminal:
$ gnuhealth-client
Hit Connect and enter the password gnusolidario.
4.1.3. openSUSE Leap
Install the requirements (downgrading Ansible because default python3 points to 3.6):
$ sudo zypper install python3-pip python311 git
$ python3.11 -m venv venv
$ source venv/bin/activate
$ pip3 install "ansible-core<2.17"
$ ansible-galaxy collection install community.crypto community.general community.postgresql ansible.posix
By default any user can become root by entering the root password. The below changes only allow the wheel group and ask for the user password itself - not the root password. This change of the sudo functionality is necessary to make swichting users in Ansible work:
$ su
# usermod -aG wheel <username>
# visudo
-> outcomment following two lines:
Defaults targetpw # ask for the password of the target user i.e. root
ALL ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!
-> uncomment following line:
# %wheel ALL=(ALL:ALL) ALL
# reboot
Follow the rest of the instructions for Ubuntu (starting with ‘git clone …’)
4.1.4. FreeBSD
This was tested with a FreeBSD 14.1 VM where UFS & MBR where chosen and the user was added to the wheel group during the installation.
Preparations as root:
$ su
# mount -o acls /
# pkg update
# pkg install git py311-pipx rust sudo bash
# ln -s /usr/local/bin/python3.11 /usr/bin/python3
# visudo
→ Uncomment or add line '%wheel ALL=(ALL:ALL) ALL'
→ Save and close by hitting 'Esc', ':wq' and 'Enter'
# exit
Install Ansible:
$ echo "export PATH=$PATH:/home/`whoami`/.local/bin" >> ~/.shrc
$ . ~/.shrc
$ pipx install ansible-core
$ ansible-galaxy collection install community.crypto community.general community.postgresql ansible.posix
Follow the rest of the instructions for Ubuntu (starting with ‘git clone …’)