# Error in expansible script

**URL:** <https://forum.ansible.com/t/error-in-expansible-script/30877>\
**Category:** Ansible Project\
**Created:** [July 26, 2019, 6:13am UTC](https://forum.ansible.com/t/error-in-expansible-script/30877 "2019-07-26T06:13:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shahzad\_Adil\_shaikh](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@Shahzad\_Adil\_shaikh](https://forum.ansible.com/u/Shahzad_Adil_shaikh)\
**Post date:** [July 26, 2019, 6:13am UTC](https://forum.ansible.com/t/error-in-expansible-script/30877/1 "2019-07-26T06:13:11Z")

</div>

Hello All,

I am trying to execute the following yml script but some errors are occurring ,please some help me out this error .

Script:-

---

<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:** [July 26, 2019, 6:15am UTC](https://forum.ansible.com/t/error-in-expansible-script/30877/2 "2019-07-26T06:15:59Z")

</div>

> Hello All,
> 
> I am trying to execute the following yml script but some errors are occurring ,please some help me out this error .
> 
> Script:-  
> ---  
> - hosts: all  
> tasks:  
> - name: Import Remi GPG key  
> rpm\_key: "key={{ item }} state=present"  
> with\_items:  
> - "[http://rpms.famillecollet.com/RPM-GPG-KEY-remi&quot](http://rpms.famillecollet.com/RPM-GPG-KEY-remi&quot);  
> - name: Install Remi repo.  
> command: "rpm -Uvh --force {{ item.href }} creates={{ item.creates }}"  
> with\_items:  
> - href: "[http://rpms.famillecollet.com/enterprise/remi-release-6.rpm&quot](http://rpms.famillecollet.com/enterprise/remi-release-6.rpm&quot);  
> creates: "/etc/yum.repos.d/remi.repo"  
> - name: Install EPEL repo.  
> yum: name=epel-release state=present  
> - name: Ensure firewalld is stopped  
> service: name=firewalld state=stopped  
> - name: Install Node.js and npm  
> yum: name=npm state=present enablerepo=epel  
> - name: Install Forever  
> npm: name=forever global=yes state=latest
> 
> Error:-  
> ERROR! Syntax Error while loading YAML.

The indentation is incorrect in the line with "rpm\_key". It needs the same position as "name".

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

---

<div class="post-metadata">

**Author:** ![Mark\_Anthony\_Garcia](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@Mark\_Anthony\_Garcia](https://forum.ansible.com/u/Mark_Anthony_Garcia)\
**Post date:** [July 26, 2019, 6:25am UTC](https://forum.ansible.com/t/error-in-expansible-script/30877/3 "2019-07-26T06:25:52Z")

</div>

like Stefan said rpm\_key and with\_items needs to be in the same line as name.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 26, 2019, 10:00am UTC](https://forum.ansible.com/t/error-in-expansible-script/30877/4 "2019-07-26T10:00:49Z")

</div>

Basically like [https://gist.github.com/mariusv/71e6e75941d495956234](https://gist.github.com/mariusv/71e6e75941d495956234)
