ansible-taler-exchange

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

commit 626c974339cc8cc1a4cd277114df36c8123dc4ef
parent 2b0b20896e8fde1fb16ba21b7637cfa952921f6f
Author: Florian Dold <florian@dold.me>
Date:   Fri,  3 Jul 2026 15:26:03 +0200

remove ansible_pull, as it's unused and untested

Diffstat:
MREADME | 7-------
Dlocal.yml | 12------------
Droles/ansible_pull/tasks/main.yml | 60------------------------------------------------------------
Droles/ansible_pull/templates/ansible-on-boot.service | 12------------
Droles/ansible_pull/templates/ansible-pull.sh | 33---------------------------------
Droles/ansible_pull/templates/pull.fact | 13-------------
Droles/ansible_pull/vars/main.yaml | 1-
Mstage-activate.sh | 20++++++++++----------
8 files changed, 10 insertions(+), 148 deletions(-)

diff --git a/README b/README @@ -167,13 +167,6 @@ The main script that deploys our entire setup. ## Roles -### ansible_pull - -This role setups an ansible-pull script on the host, as well as cronjob -which runs the ansible-pull script on regular interval. - -NOTE: requires local.yml to exist in root of this repo. - ### auditor Deploys the auditor. diff --git a/local.yml b/local.yml @@ -1,12 +0,0 @@ ---- - -# FIXME(dold): What does this file do / why do we need it? -# FIXME(dold): Seems incomplete. - -- name: Local setup - hosts: all - roles: - - common_packages - - ansible_pull - - webserver - - database diff --git a/roles/ansible_pull/tasks/main.yml b/roles/ansible_pull/tasks/main.yml @@ -1,60 +0,0 @@ -- name: Update apt cache - apt: - update_cache: true - -- name: Install depends - apt: - name: [ansible, git] - state: present - -- name: Ensure /etc/ansible/facts.d exists - file: - path: /etc/ansible/facts.d - state: directory - recurse: true - mode: "0700" - owner: root - group: root - -- name: Make /etc/ansible/facts.d/pull.fact - template: - src: pull.fact - dest: /etc/ansible/facts.d/pull.fact - mode: "0700" - owner: root - group: root - -- name: Recollect facts - setup: - -- name: Install the ansible-pull script - template: - src: ansible-pull.sh - dest: /usr/sbin/run-ansible-pull - mode: "0755" - owner: root - group: root - -- name: Install cronjob - cron: - name: "Ansible Pull" - minute: "{{ ansible_local.pull.minute | default(59 | random) }}" - job: /usr/sbin/run-ansible-pull - -- name: Remove old ansible-pull on boot cronjob - cron: - name: run ansible on reboot - state: absent - -- name: Install service to run ansible-pull on boot - template: - src: ansible-on-boot.service - dest: /etc/systemd/system/ansible-on-boot.service - mode: "0755" - owner: root - group: root - -- name: Enable ansible pull on boot - service: - name: ansible-on-boot - enabled: true diff --git a/roles/ansible_pull/templates/ansible-on-boot.service b/roles/ansible_pull/templates/ansible-on-boot.service @@ -1,12 +0,0 @@ -[Unit] -Description=ansible-pull on boot -After=network-online.target -Wants=network-online.target - -[Service] -Type=oneshot -ExecStartPre=/bin/sh -c 'until ping -c 1 -w 1 git.taler.net; do sleep 1; done' -ExecStart=/usr/bin/ansible-pull -U https://git.taler.net/ansible-taler-exchange.git -d /var/run/ansible/ansible-taler-exchange - -[Install] -WantedBy=multi-user.target diff --git a/roles/ansible_pull/templates/ansible-pull.sh b/roles/ansible_pull/templates/ansible-pull.sh @@ -1,33 +0,0 @@ -#!/bin/bash - -{% macro run_playbook(url, name, branch=none) %} - start=$(date +%s) - ansible-pull -U {{ url }} {% if branch is not none %}-C {{ branch}} {% endif %} -d /var/run/ansible/{{ name }}&> /var/log/ansible-{{ name }}.log - code=$? - - if [ -d /var/lib/prometheus/node-exporter ]; then - prom_file="/var/lib/prometheus/node-exporter/ansible-playbook-{{ name }}.prom" - labels="playbook=\"{{ name }}\", playbook_url=\"{{ url }}\", playbook_branch=\"{{ branch }}\"" - echo "# HELP ansible_playbook_exit_code The exit code of ansible-pull" > ${prom_file} - echo "# TYPE ansible_playbook_exit_code gauge" >> ${prom_file} - echo "ansible_playbook_exit_code{${labels}} ${code}" >> ${prom_file} - - echo "# HELP ansible_playbook_time The time a playbook took to run, in seconds" >> ${prom_file} - echo "# TYPE ansible_playbook_time gauge" >> ${prom_file} - echo "ansible_playbook_time{${labels}} $(expr $(date +%s) - ${start})" >> ${prom_file} - fi -{%- endmacro %} - -if [ "$1" == "nodisown" ]; then - # Sometimes the $PATH gets messed up in cron, so lets start by setting the record straight - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - -{{ run_playbook(ansible_local.pull.repo, "ansible-taler-exchange", ansible_local.pull.branch) }} -{% if "additional_playbooks" in ansible_local %} -{% for playbook in ansible_local.additional_playbooks %} -{{ run_playbook(playbook.url, playbook.name, playbook.branch) }} -{% endfor %} -{% endif %} -else - $0 nodisown & disown -fi diff --git a/roles/ansible_pull/templates/pull.fact b/roles/ansible_pull/templates/pull.fact @@ -1,13 +0,0 @@ -{ -{% if ansible_local is defined and ansible_local.pull is defined and ansible_local.pull is mapping %} - "repo": "{% if ansible_local.pull.repo and ansible_local.pull.repo != "https://git.taler.net/ansible-taler-exchange.git" %}{{ ansible_local.pull.repo }}{% else %}https://git.taler.net/ansible-taler-exchange.git{% endif %}", - "branch": "{% if ansible_local.pull.branch and ansible_local.pull.branch != "master" %}{{ ansible_local.pull.branch }}{% else %}main{% endif %}", - "minute": {% if ansible_local.pull.minute %}{{ ansible_local.pull.minute }}{% else %}{{ 59 | random }}{% endif %} - -{% else %} - "repo": "https://git.taler.net/ansible-taler-exchange.git", - "branch": "dev/devan-carpenter/development", - "minute": "{{ 59 | random }}" - -{% endif %} -} diff --git a/roles/ansible_pull/vars/main.yaml b/roles/ansible_pull/vars/main.yaml @@ -1 +0,0 @@ -playbooks: diff --git a/stage-activate.sh b/stage-activate.sh @@ -7,16 +7,16 @@ taler-exchange-offline \ download sign upload -#taler-exchange-offline \ -# -c stage-offline.conf \ -# wire-fee now iban CHF:0 CHF:0 \ -# global-fee now CHF:0 CHF:0 CHF:0 "1 d" "1 year" 1000 \ -# enable-account 'payto://iban/CH1130000001166556117?receiver-name=Taler+Operations+AG&receiver-postal-code=2502&receiver-town=Biel-Bienne' \ -# prepared-transfer-url 'https://nexus.stage.taler-ops.ch/taler-prepared-transfer/' \ -# credit-restriction regex 'payto://iban/CH.*' "Swiss bank accounts only" '{}' \ -# debit-restriction regex 'payto://iban/CH.*' "Swiss bank accounts only" '{}' \ -# enable-auditor P6B7ZS7Y1Y12S0VP0PAJ1GQGSHW8RE4NSBTP8PR254J18SK24MH0 https://auditor.stage.taler-ops.ch/ "Taler Operations AG" \ -# upload +taler-exchange-offline \ + -c stage-offline.conf \ + wire-fee now iban CHF:0 CHF:0 \ + global-fee now CHF:0 CHF:0 CHF:0 "1 d" "1 year" 1000 \ + enable-account 'payto://iban/CH1130000001166556117?receiver-name=Taler+Operations+AG&receiver-postal-code=2502&receiver-town=Biel-Bienne' \ + prepared-transfer-url 'https://nexus.stage.taler-ops.ch/taler-prepared-transfer/' \ + credit-restriction regex 'payto://iban/CH.*' "Swiss bank accounts only" '{}' \ + debit-restriction regex 'payto://iban/CH.*' "Swiss bank accounts only" '{}' \ + enable-auditor P6B7ZS7Y1Y12S0VP0PAJ1GQGSHW8RE4NSBTP8PR254J18SK24MH0 https://auditor.stage.taler-ops.ch/ "Taler Operations AG" \ + upload taler-exchange-offline \ -c stage-offline.conf \