I'm trying to use a block with Ansible. I got stuck with some error. need urgent help.
---
- name: transferring debian artifact to server
- block:
- copy:
src: "{{ lookup('fileglob','{{base_git_path}}testserver/target/*.deb', wantlist=true) | first }}"
dest: "{{base_destination_path}}"
owner: xyz
group: xyz
mode: 644
become: true
rescue:
- debug: msg="error while locating debian file in tmp directory"
Error:
fatal: [akka_1]: FAILED! => {"failed": true, "reason": "Syntax Error while loading YAML.\n\n\nThe error appears to have been in '/home/user/test/ansible/testproj/playbooks/roles/tmp3/tasks/synchronize.yml': line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n- name: transferring debian artifact to server\n - block:\n ^ here\n"}