main.yml (831B)
1 --- 2 - name: Get current date 3 ansible.builtin.command: 4 cmd: "date +%F" 5 register: today 6 7 - name: Create temporary file as destination for the import 8 ansible.builtin.tempfile: 9 path: /tmp 10 prefix: "exchange-sanctionlist-import-{{ today.stdout }}-" 11 suffix: .xml 12 register: importfile 13 14 - name: Push file to local system 15 copy: 16 src: "{{ SANCTION_LIST }}" 17 dest: "{{ importfile.path }}" 18 owner: taler-exchange-httpd 19 mode: "400" 20 21 - name: Check sanction list 22 ansible.builtin.command: 23 cmd: "taler-exchange-sanctionscheck -- {{ EXCHANGE_SANCTION_HELPER }} {{ importfile.path }}" 24 become: true 25 become_user: taler-exchange-httpd 26 27 # - name: Remove the temporary file on the server 28 # ansible.builtin.file: 29 # path: "{{ importfile.path }}" 30 # state: absent 31 # when: importfile.path is defined