ansible-taler-exchange

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

setup.yml (2961B)


      1 ---
      2 - name: Deploy gnu Taler
      3   hosts: all
      4   any_errors_fatal: true
      5   pre_tasks:
      6     - name: "Fail if the deployment kind is not defined"
      7       ansible.builtin.fail:
      8         msg: "deployment_kind is not set; it selects the exchange_$KIND role"
      9       when: deployment_kind is undefined
     10 
     11     - name: "Check the secrets every deployment needs"
     12       ansible.builtin.assert:
     13         that: exchange_attribute_encryption_key is defined
     14         quiet: true
     15 
     16     - name: Restrict mock MFA to the Rusty staging host
     17       ansible.builtin.assert:
     18         that: inventory_hostname == 'rusty'
     19         fail_msg: >-
     20           devtesting_mock_mfa exposes MFA codes and may only be enabled on
     21           the Rusty staging host.
     22         quiet: true
     23       when: devtesting_mock_mfa | bool
     24 
     25     - name: "Check the KYCAID secrets"
     26       when: deployment_kind == 'tops'
     27       ansible.builtin.assert:
     28         that: exchange_kycaid_access_token is defined
     29         quiet: true
     30 
     31     - name: "Check the auditor secrets"
     32       when: deploy_auditor | bool
     33       ansible.builtin.assert:
     34         that: auditor_access_token is defined
     35         quiet: true
     36 
     37     - name: "Check the monitoring secrets"
     38       when: deploy_monitoring | bool
     39       ansible.builtin.assert:
     40         that:
     41           - loki_access_token is defined
     42           - prometheus_access_token is defined
     43         quiet: true
     44 
     45     - name: Disable existing monitoring stack
     46       ansible.builtin.include_role:
     47         name: monitoring
     48         tasks_from: disable
     49       when: not (deploy_monitoring | bool)
     50 
     51     - name: "Check the challenger secrets"
     52       when: deploy_challenger | bool
     53       ansible.builtin.assert:
     54         that:
     55           - sms_challenger_telesign_auth_token is defined
     56           - postal_challenger_pingen_client_id is defined
     57           - postal_challenger_pingen_client_secret is defined
     58           - postal_challenger_pingen_org_id is defined
     59         quiet: true
     60 
     61     - name: "Check the EBICS secrets"
     62       when: use_ebics | bool or configure_ebics | bool
     63       ansible.builtin.assert:
     64         that:
     65           - libeufin_nexus_ebics_host_base_url is defined
     66           - libeufin_nexus_ebics_host_id is defined
     67           - libeufin_nexus_ebics_user_id is defined
     68           - libeufin_nexus_ebics_partner_id is defined
     69           - libeufin_nexus_ebics_system_id is defined
     70         quiet: true
     71 
     72   roles:
     73     - role: common_packages
     74     - role: webserver
     75     - role: database
     76     - role: libeufin-nexus
     77     - role: challenger
     78       when: deploy_challenger | bool
     79       postexchange: false
     80     - role: exchange
     81     - role: challenger
     82       postexchange: true
     83       when: deploy_challenger | bool
     84     - role: auditor
     85       when: deploy_auditor | bool
     86     - role: monitoring
     87       when: deploy_monitoring | bool
     88     - role: devtesting
     89       when: dangerously_enable_devtesting | bool
     90 
     91   post_tasks:
     92     - name: Run post-deployment sanity checks
     93       ansible.builtin.include_role:
     94         name: post_deployment_checks