main.yml (1053B)
1 --- 2 - name: Get current date 3 ansible.builtin.command: 4 cmd: "date +%F" 5 register: today 6 changed_when: false 7 8 - name: Create temporary file as destination for the import 9 ansible.builtin.tempfile: 10 path: /tmp 11 prefix: "exchange-sanctionlist-import-{{ today.stdout }}-" 12 suffix: .xml 13 register: importfile 14 15 - name: Import and check the sanction list 16 block: 17 - name: Push file to local system 18 copy: 19 src: "{{ sanction_list }}" 20 dest: "{{ importfile.path }}" 21 owner: taler-exchange-httpd 22 mode: "0400" 23 24 # --reset makes the tool go over all historic records again, which is 25 # the point of importing a new list. 26 - name: Check sanction list 27 ansible.builtin.command: 28 cmd: "taler-exchange-sanctionscheck --reset -- {{ exchange_sanction_helper }} {{ importfile.path }}" 29 become: true 30 become_user: taler-exchange-httpd 31 always: 32 - name: Remove the temporary file on the server 33 ansible.builtin.file: 34 path: "{{ importfile.path }}" 35 state: absent