Thank You James for pointing out the mistakes.

I fixed them and now the json playbook works.



On Wednesday, June 26, 2019 at 7:20:41 PM UTC-4, James Cassell wrote:
>
>
> On Wed, Jun 26, 2019, at 6:08 PM, Narahari 'n' Savitha wrote: 
> > Hello Folkds: 
> > 
> > Thank you in advance for your time and attention. 
> > 
> > I wrote a playbook in the json format. 
> > 
> > > [ 
> > >  { 
> > >  "name": "Test the json mode" 
>
> Missing a comma. 
>
> > >  "hosts": "cool_columbus", 
> > >  "tasks": [ 
> > >  { 
> > >  "name": "First task" 
>
> Missing comma. 
>
> > >  "shell": { 
> > >  "chdir": "/tmp", 
> > >  "free_form": "ls -l", 
> > >  } 
> > >  } 
> > >  ] 
> > >  } 
> > > ] 
> > 
> > when I run it with the command 
> > 
> > >>  ansible-playbook test_playbook.jsonERROR! Syntax Error while loading 
> YAML. expected ',' or '}', but got '<scalar>' 
> > >> The error appears to have been in 
> '/home/pidansible/test_playbook.json': line 4, column 5, but maybe 
> elsewhere in the file depending on the exact syntax problem. 
> > >> The offending line appears to be: 
> > 
> > 
> > What am I doing wrong and how to run this ? 
> > 
> > Please help. 
> > 
> > -N 
>
> V/r, 
> James Cassell 
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c0159d4b-f882-4fba-a590-7665a7b2e3ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to