This role allows you to install the current version of SQL-Ledger on Debian Trixie.
Clone the code to your Ansible roles directory:
git clone https://github.com/Tekki/ansible-sql-ledger.git $PATH_TO_ANSIBLE/roles/sql-ledgerThe machine from which the playbook is run needs a recent Ansible version. In most Linux distributions, it is available through the official package repository. For detailed information how to obtain current packages for your distribution of choice have a look at the Ansible documentation.
The target machine needs SSH access, Python and sudo. Standard Debian comes with Python, but without sudo, so you have to install it and update your host configuration accordingly:
ansible_become: true
ansible_become_pass: "{{ vault_sudo_pwd }}"The following variables can be passed to this role:
| Variable Name | Default Value | Description |
|---|---|---|
| debian_additional_packages | [] | additional packages to be installed |
| debian_locale | en_US | default UTF-8 locale |
| sl_admin_pwd | undefined | password for admin.pl |
| sl_dvipdf | false | use dvipdf instead of pdflatex |
| sl_git_branch | full | branch that will be checked out |
| sl_git_source | https://github.com/Tekki/sql-ledger.git | URL of the Git repository |
| sl_helpful_login | false | helpful error messages on login screen |
| sl_httpd_config | /etc/apache2 | path to the webserver config |
| sl_httpd_path | /var/www/sql-ledger | local path of the installation |
| sl_httpd_url | sql-ledger | browser URL on the server |
| sl_latex | true | install and use LaTeX |
| sl_latex_pdftk | true | use pdftk to combine PDFs |
| sl_latex_xelatex | true | use XeLaTeX instead of pdflatex |
| sl_login_language | language of the login screen | |
| sl_postgres_user | sql-ledger | user name to connect to PostgreSQL |
| sl_protect_admin | false | protect admin interface |
| sl_protect_password | password for protected admin interface | |
| sl_protect_username | username for protected admin interface | |
| sl_sendmail | "| /usr/sbin/sendmail -f <%from%> -t" | pipe to sendmail |
| sl_timezone | Europe/Zurich | time zone for server |
| texlive_lang | english | language of TeX Live that will be installed |
Please notice that this role doesn't install a mail transport agent or printing system.
To install with the default settings and language German/Switzerland (chd_utf) on the login screen, use the following playbook:
- hosts: sql-ledger-servers
roles:
- name: sql-ledger
debian_locale: de_CH
sl_login_language: chd_utf
texlive_lang: germanOr better move the variables to the host configuration file:
ansible_become: true
ansible_become_pass: "{{ vault_sudo_pwd }}"
debian_locale: de_CH
sl_login_language: chd_utf
texlive_lang: germanIf you want to set the password for admin.pl to '12345678' (probably not a good idea), write:
sl_admin_pwd: 12345678Use the Vault to protect your passwords!
To make the original version from DWS available under /sl-dws, write:
sl_httpd_path: /var/www/sl-dws
sl_httpd_url: sl-dws
sl_git_branch: dwsIt is possible to install the role multiple times under different URLs on the same server.
If your hosts are defined in sql-ledger.hosts in this way:
[sql-ledger-servers]
sl-server-[01:05]
and the name of the playbook is sql-ledger.yml, you can start the installation with:
ansible-playbook -i sql-ledger.hosts sql-ledger.ymlBe aware that the installation of texlive needs a lot of time.
The available tags are:
sl-basicsinstalls the basic packagessl-configupdates sql-ledger and wlprinter configsl-databaseconfigures the access to the databasesl-gitdownloads SQL-Ledger from GitHubsl-latexinstalls LaTeX, if sl_latex is truesl-webserverconfigures the webserver, including password protection
To update the installation, simply run the playbook again. If you just want to download a new version:
ansible-playbook -t sl-git sql-ledger.yml© 2016-2025 Tekki (Rolf Stöckli)