Я использую AWX и пытаюсь выполнить эту задачу:
- name: cleanup
shell: awk '{ a[$1 OFS] = a[$1 OFS] ( a[$1 OFS] == "" ? "" : OFS) $2 }END{ for (i in a){print i,a[i]} } OFS="\t" latest.txt "{{ inventory_hostname }}".txt > ./output/"{{ inventory_hostname }}".txt
Но я получаю эту ошибку:
> ERROR! Syntax Error while loading YAML. did not find expected key
> The error appears to be in
> '/tmp/awx_8887_nv3efn13/project/Simsek/test/test.yml': line 141,
> column 60, but may be elsewhere in the file depending on the exact
> syntax problem. The offending line appears to be:
> - name: cleanup
> shell: "awk '{ a[$1 OFS] = a[$1 OFS] ( a[$1 OFS] == "" ? "" : OFS) $2 }END{ for (i in a){print i,a[i]} } OFS="\t" latest.txt "{{
> inventory_hostname }}".txt > ./output/"{{ inventory_hostname }}".txt"
> ^ 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:
> with_items:
> - {{ foo }} Should be written as:
> with_items:
> - "{{ foo }}"