I'm using the below playbook but it's giving me an error
the playbook is 

*---*
*- hosts: localhost*
*  ignore_errors: yes*
*  become: yes*

*  tasks:*

*    - name: Run Vuls Scans*
*      shell: curl -X POST -H "Content-Type: text/plain" -H 
"X-Vuls-OS-Family: `lsb_release -si | awk '{print tolower($1)}'`" -H 
"X-Vuls-OS-Release: `lsb_release -sr | awk '{print $1}'`" -H 
"X-Vuls-Kernel-Release: `uname -r`" -H "X-Vuls-Server-Name: `hostname`" 
--data-binary "$(dpkg-query -W 
-f="\${binary:Package},\${db:Status-Abbrev},\${Version},\${Source},\${source:Version}\n")"
 
https://abc.com/vuls > /path/to/report.json*

But, it's giving me the following error:

*ERROR! We were unable to read either as JSON nor YAML, these are the 
errors we got from each:*
*JSON: No JSON object could be decoded*

*Syntax Error while loading YAML.*
*  mapping values are not allowed in this context*

*The error appears to be in '/etc/ansible/vuls.yml': line 9, column 43, but 
may*
*be elsewhere in the file depending on the exact syntax problem.*

*The offending line appears to be:*

*    - name: Run Vuls Scans*
*      shell: curl -X POST -H "Content-Type: text/plain" -H 
"X-Vuls-OS-Family: `lsb_release -si | awk '{print tolower($1)}'`" -H 
"X-Vuls-OS-Release: `lsb_release -sr | awk '{print $1}'`" -H 
"X-Vuls-Kernel-Release: `uname -r`" -H "X-Vuls-Server-Name: `hostname`" 
--data-binary "$(dpkg-query -W 
-f="\${binary:Package},\${db:Status-Abbrev},\${Version},\${Source},\${source:Version}\n")"
 
https://abc.com/vuls > /path/to/report.json                                
                            *
*                                          ^ here*
*We could be wrong, but this one looks like it might be an issue with*
*unbalanced quotes. If starting a value with a quote, make sure the*
*line ends with the same set of quotes. For instance this arbitrary*
*example:*

*    foo: "bad" "wolf"*

*Could be written as:*

*    foo: '"bad" "wolf"'*

Can anyone tell me what changes need to be done?

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/25a404d1-c29e-48a9-9de4-4004a6f7007dn%40googlegroups.com.

Reply via email to