Below is my playbook:
- name: "Collecting File details"
shell: "ls -ltr {{ item }} | awk '{$2=$4=$5=""; print $0}' | tr '\n'
'\t' | tr -s " ";
with_fileglob:
- "{{ playbook_dir }}/tmpfiles/*"
I get syntax error due to the awk command as below.
ERROR! Syntax Error while loading YAML.
> did not find expected key
> shell: "ls -ltr {{ item }} | awk '{$2=$4=$5=""; print $0}' | tr '\n'
> '\t' | tr -s " ";
> ^
> here
> We could be wrong, but this one looks like it might be an issue with
> missing quotes. Always quote template expression brackets when they
> start a value. For instance:
Can you please suggest how can I incorporate such a awk in ansible shell
module ?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/a875de81-8395-4700-a395-f186562675d9%40googlegroups.com.