I want my filedet.yaml to look like
10.9.75.78: /app/tmp/tmp.log, /vars/tmp/test.out
10.9.55.74: /app/tmp/tmp1.log, /vars/tmp/admin.out
The below works fine and logs the data correctly but when i add ': ’ the syntax breaks and I get error
`
- name: Logging the deployment’s file details to a Ansible variable file
local_action: lineinfile line={{ inventory_hostname }}': '{{ vars[‘fdetails_’ + Layer].results|map(attribute=‘stdout’)|list }} path={{ playbook_dir }}/vars/filedets.yaml
`
Output Error:
The offending line appears to be:
local_action: lineinfile line={{ inventory_hostname }}': '{{ vars[‘fdetails_’ + Layer].results|map(attribute=‘stdout’)|list }} path={{ playbook_dir }}/vars/filedets.yaml
^ 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 inject the colons and space ': ’ between the the variable in line ?