Dhis2-server-tools support for Debian

We have a AWS server that is already up running Debian 12 that we would like to install dhis2 on via ansible. Unfortunately, it already has some other apps in other containers running on it, so I would like to avoid having to switch it over to Ubuntu. Is there any plan to add Debian support to the dhis2-server-tools workflow?

So far, I have sidestepped some of issues in the deploy.sh script by just installing ansible manually as an “other” distro:

sudo apt -yq update
sudo apt install -yq  git
sudo apt install -yq software-properties-common
sudo apt install -yq ansible
sudo -E apt-get -yq autoclean
# install community general collections 
ansible-galaxy collection install community.general

However, when I get to the the actual deployment script via ansible-playbook I get the following error on the Getting lxc info TASK:

$ sudo ansible-playbook dhis2-server-tools/deploy/dhis2.yml

TASK [pre-install : Getting lxc info] ***********************************************************************************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "lxc info", "msg": "[Errno 2] No such file or directory: b'lxc'", "rc": 2, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

Running lxc info myself runs without issue, so I am not sure where exactly the error message is coming from. Likely with how the output is getting saved in ansible, but I am not familiar enough with ansible to pinpoint it.

Any help would be much appreciated! Also happy to submit an issue or PR once I have the script working for Debian if that is support you are interested in adding.

Hello @mv_evans,
The tooling currently supports deployment on Ubuntu LTS releases. However, since the setup relies on LXD containers, extending support to Debian hosts should be relatively straightforward and is a worthwhile improvement to consider.

As for the error encountered in the Getting lxc info task, it’s unlikely to be caused by the underlying OS. The task executes the lxd info command, which should work on any Linux distribution where LXD is properly installed and configured.

The error message — “No such file or directory” — typically indicates that the lxc binary is either not installed or not available in the executing user’s PATH. Please verify that:

  • LXD is installed on the target host.
  • The lxc command is available in the system’s PATH.
  • The user running Ansible has the necessary permissions to execute lxc commands.
1 Like

Thanks for the reply @tkipkurgat !

LXD was installed, but via snap (as recommended by the LXD developers). I installed it from the standard apt repository (sudo apt install lxd) and this seemed to solve the problem. Not sure if it was solely a snap issue or if I needed to add the snap binary to the PATH, but this work around seems to be fine (and reduces the need for a snap dependency!).

1 Like