feat(infrastructure): introduce ansible deployment for taler services

- add ansible playbooks and roles for deploying taler exchange and merchant
- configure PostgreSQL, GNU Taler repositories, and services

🔧 chore(config): provide example env and gitignore for sensitive files

- create .env-example with placeholders for sensitive info
- add .gitignore entries for .env and common editor files
This commit is contained in:
nocci 2025-11-03 13:15:46 +00:00
parent ca89a06864
commit fdc9234540
18 changed files with 525 additions and 0 deletions

View file

@ -0,0 +1,63 @@
- name: Ensure master public key is provided
ansible.builtin.assert:
that:
- taler_config.exchange_master_key is defined
- taler_config.exchange_master_key | length > 0
fail_msg: "Provide TALER_MASTER_PUBLIC_KEY in .env before running exchange deployment."
- name: Install GNU Taler exchange packages
ansible.builtin.apt:
name:
- taler-exchange
- taler-exchange-httpd
- taler-exchange-aggregator
- taler-exchange-closer
- taler-exchange-transfer
- taler-exchange-wirewatch
state: present
- name: Ensure exchange runtime directories exist
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: taler-exchange-httpd
group: taler-exchange-httpd
mode: "0750"
loop:
- /var/lib/taler/exchange
- /etc/taler/conf.d
- name: Deploy exchange configuration
ansible.builtin.template:
src: exchange.conf.j2
dest: /etc/taler/conf.d/exchange.conf
owner: root
group: root
mode: "0640"
notify:
- Restart taler-exchange-httpd
- Restart taler-exchange-aggregator
- Restart taler-exchange-closer
- Restart taler-exchange-transfer
- Restart taler-exchange-wirewatch
- name: Run taler-exchange-dbinit
ansible.builtin.command:
cmd: taler-exchange-dbinit -c /etc/taler/conf.d/exchange.conf
register: dbinit_result
changed_when: "'already initialized' not in dbinit_result.stdout"
failed_when: dbinit_result.rc not in [0]
become: true
become_user: taler-exchange-httpd
- name: Validate exchange configuration
ansible.builtin.command:
cmd: taler-config -c /etc/taler/conf.d/exchange.conf -s exchange -o CURRENCY
register: exchange_config_validation
changed_when: false
- name: Assert exchange currency matches expected
ansible.builtin.assert:
that:
- exchange_config_validation.stdout.strip() == taler_config.currency
fail_msg: "Exchange currency does not match expected value {{ taler_config.currency }}. Check configuration."