# Showing Syntax error in a module

**URL:** <https://forum.ansible.com/t/showing-syntax-error-in-a-module/23858>\
**Category:** Ansible Project\
**Created:** [March 2, 2017, 7:47am UTC](https://forum.ansible.com/t/showing-syntax-error-in-a-module/23858 "2017-03-02T07:47:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nexio.global](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@nexio.global](https://forum.ansible.com/u/nexio.global)\
**Post date:** [March 2, 2017, 7:47am UTC](https://forum.ansible.com/t/showing-syntax-error-in-a-module/23858/1 "2017-03-02T07:47:09Z")

</div>

Hello, I am trying to deploying wordpress using Ansible for first time. I installed LAMP on my remote server using Ansible but there was a syntax error while I was trying to install wordpress. it shows–

The error appears to have been in ‘/home/nxadmin/wordpress-ansible/roles/wordpress/tasks/main.yml’: line 2, column 36, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 2, 2017, 4:48pm UTC](https://forum.ansible.com/t/showing-syntax-error-in-a-module/23858/2 "2017-03-02T16:48:59Z")

</div>

> Hello, I am trying to deploying wordpress using Ansible for first time. I  
> installed LAMP on my remote server using Ansible but there was a syntax  
> error while I was trying to install wordpress. it shows--
> 
> The error appears to have been in  
> '/home/nxadmin/wordpress-ansible/roles/wordpress/tasks/main.yml': line 2,  
> column 36, but may  
> be elsewhere in the file depending on the exact syntax problem.
> 
> The offending line appears to be:
> 
> ---  
> - name: Download WordPress get\_url:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^ here
> 
> My script for deploying Word Press in roles/wordpress/tasks/main.yml are-
> 
> ---  
> - name: Download WordPress get\_url:  
> &nbsp;&nbsp;&nbsp;&nbsp;url=[https://wordpress.org/latest.tar.gz](https://wordpress.org/latest.tar.gz)  
> &nbsp;&nbsp;&nbsp;&nbsp;dest=/tmp/wordpress.tar.gz  
> &nbsp;&nbsp;&nbsp;&nbsp;validate\_certs=no

The module name, get\_url, must be on the next line, and not on the same line as - name:.  
- name: Download WordPress  
&nbsp;&nbsp;&nbsp;get\_url:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url=[https://wordpress.org/latest.tar.gz](https://wordpress.org/latest.tar.gz)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dest=/tmp/wordpress.tar.gz  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;validate\_certs=no

> - name: Extract WordPress unarchive= src=/tmp/wordpress.tar.gz  
> dest=/var/www/ copy=no  
> &nbsp;&nbsp;sudo: yes

The same goes for this one, unarchive: must be on the next line.  
And you need to use a colon and not a equal sign after the module name.

---

<div class="post-metadata">

**Author:** ![nexio.global](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@nexio.global](https://forum.ansible.com/u/nexio.global)\
**Post date:** [March 3, 2017, 5:13am UTC](https://forum.ansible.com/t/showing-syntax-error-in-a-module/23858/3 "2017-03-03T05:13:00Z")

</div>

Thank you for helping me I tried that solution but now it is showing syntax error on different module

The offending line appears to be:

- name: Update default Apache site  
^ here

Can you please check the whole script and tell me all the mistakes I have been done in this. It would be very thankful

Thank you

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 3, 2017, 8:08am UTC](https://forum.ansible.com/t/showing-syntax-error-in-a-module/23858/4 "2017-03-03T08:08:13Z")

</div>

I did an corrected them all except for sudo: that should be become:, but sudo will work, you just get a deprecation message.  
You have probably introduced new ones, so without the new code it's difficult to see what's wrong now.  
But your code should look like this now.

---

<div class="post-metadata">

**Author:** ![nexio.global](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@nexio.global](https://forum.ansible.com/u/nexio.global)\
**Post date:** [March 3, 2017, 9:01am UTC](https://forum.ansible.com/t/showing-syntax-error-in-a-module/23858/5 "2017-03-03T09:01:41Z")

</div>

It is working now. Thank you very much for helping me. 🙂
