# shell

**URL:** <https://forum.ansible.com/t/shell/31233>\
**Category:** Ansible Project\
**Created:** [September 9, 2019, 11:13am UTC](https://forum.ansible.com/t/shell/31233 "2019-09-09T11:13:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manish\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@Manish\_Kumar](https://forum.ansible.com/u/Manish_Kumar)\
**Post date:** [September 9, 2019, 11:13am UTC](https://forum.ansible.com/t/shell/31233/1 "2019-09-09T11:13:09Z")

</div>

Hi,

Please help me with this error which I am getting below :

play-book:

---

<div class="post-metadata">

**Author:** ![Sebastian\_Meyer](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@Sebastian\_Meyer](https://forum.ansible.com/u/Sebastian_Meyer)\
**Post date:** [September 9, 2019, 11:49am UTC](https://forum.ansible.com/t/shell/31233/2 "2019-09-09T11:49:48Z")

</div>

> Hi,
> 
> Please help me with this error which I am getting below :
> 
> play-book:
> 
> ---  
> - name: Directory creation with current date  
> &nbsp;&nbsp;hosts: local  
> &nbsp;&nbsp;user: manish  
> &nbsp;&nbsp;sudo: yes
> 
> &nbsp;&nbsp;tasks:
> 
> &nbsp;&nbsp;- name: Ansible fact - ansible\_date\_time  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shell: date.sh  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;args:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chdir: /home/manish/mk/ansible/linux/
> 
> Error:
> 
> ERROR! Syntax Error while loading YAML.  
> &nbsp;&nbsp;mapping values are not allowed in this context

Your indentation is incorrect. The last three lines need 2 spaces less  
indentation each.

Sebastian

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [September 9, 2019, 11:51am UTC](https://forum.ansible.com/t/shell/31233/3 "2019-09-09T11:51:32Z")

</div>

> Hi,
> 
> Please help me with this error which I am getting below :
> 
> play-book:
> 
> ---  
> - name: Directory creation with current date  
> hosts: local  
> user: manish  
> sudo: yes
> 
> tasks:
> 
> - name: Ansible fact - ansible\_date\_time  
> shell: date.sh  
> args:  
> chdir: /home/manish/mk/ansible/linux/
> 
> Error:
> 
> ERROR! Syntax Error while loading YAML.  
> mapping values are not allowed in this context
> 
> The error appears to be in '/home/manish/mk/ansible/linux/main.yml': line 10, column 11, but may  
> be elsewhere in the file depending on the exact syntax problem.
> 
> The offending line appears to be:
> 
> - name: Ansible fact - ansible\_date\_time  
> shell: date.sh  
> ^ here

Fix your indentation, it should look like that:

- name: Ansible fact - ansible\_date\_time  
&nbsp;&nbsp;shell: date.sh  
&nbsp;&nbsp;args:  
&nbsp;&nbsp;&nbsp;&nbsp;chdir: /home/manish/mk/ansible/linux/

It really doesn't hurt to thoroughly read the error message and look at the documentation basics.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
