ansible-taler-exchange

Ansible playbook to deploy a production Taler Exchange
Log | Files | Refs | README | LICENSE

commit a824483ec336f604fd9366eec27d38618dc7d565
parent d2ec9602577a2d52ae44c141b701780e56b533f3
Author: Florian Dold <dold@taler.net>
Date:   Fri, 31 Jul 2026 15:39:38 +0200

stop the services that actually exist

The challenger role stopped challenger-httpd without first checking that
the unit exists, which fails on a host where the package has not been
installed yet.

The exchange role decided whether to start taler-exchange-sanctionscheck
from service facts gathered before the package was installed, so on a
fresh host the service was never started.

stop_services referred to the challengers as *-challenger-httpd.target,
but the units are services, so none of them were ever stopped; the
libeufin-nexus units were missing entirely.

Diffstat:
Mroles/challenger/tasks/pre-exchange.yml | 1+
Mroles/exchange/tasks/main.yml | 3+++
Mroles/stop_services/tasks/main.yml | 24++++++++++++++++++------
3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/roles/challenger/tasks/pre-exchange.yml b/roles/challenger/tasks/pre-exchange.yml @@ -7,6 +7,7 @@ name: challenger-httpd state: stopped enabled: false + when: '"challenger-httpd.service" in ansible_facts["services"]' - name: Ensure SMS challenger service is stopped before we upgrade ansible.builtin.systemd: diff --git a/roles/exchange/tasks/main.yml b/roles/exchange/tasks/main.yml @@ -32,6 +32,9 @@ state: latest when: ansible_facts["os_family"] == 'Debian' +- name: Refresh the list of services after the installation + service_facts: + - name: Check if Typst binary exists ansible.builtin.stat: diff --git a/roles/stop_services/tasks/main.yml b/roles/stop_services/tasks/main.yml @@ -18,24 +18,36 @@ - name: Stop postal-challenger systemd: - name: postal-challenger-httpd.target + name: postal-challenger-httpd.service state: stopped - when: '"postal-challenger-httpd.target" in ansible_facts["services"]' + when: '"postal-challenger-httpd.service" in ansible_facts["services"]' - name: Stop sms-challenger systemd: - name: sms-challenger-httpd.target + name: sms-challenger-httpd.service state: stopped - when: '"sms-challenger-httpd.target" in ansible_facts["services"]' + when: '"sms-challenger-httpd.service" in ansible_facts["services"]' - name: Stop email-challenger systemd: - name: email-challenger-httpd.target + name: email-challenger-httpd.service state: stopped - when: '"email-challenger-httpd.target" in ansible_facts["services"]' + when: '"email-challenger-httpd.service" in ansible_facts["services"]' - name: Stop auditor systemd: name: taler-auditor.target state: stopped when: '"taler-auditor.target" in ansible_facts["services"]' + +- name: Stop libeufin-nexus + systemd: + name: libeufin-nexus.target + state: stopped + when: '"libeufin-nexus.target" in ansible_facts["services"]' + +- name: Stop libeufin-nexus-httpd + systemd: + name: libeufin-nexus-httpd.service + state: stopped + when: '"libeufin-nexus-httpd.service" in ansible_facts["services"]'