# Newbie question on syntax

**URL:** <https://forum.ansible.com/t/newbie-question-on-syntax/25411>\
**Category:** Ansible Project\
**Created:** [September 5, 2017, 6:51pm UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411 "2017-09-05T18:51:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenny\_Barnes](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@Kenny\_Barnes](https://forum.ansible.com/u/Kenny_Barnes)\
**Post date:** [September 5, 2017, 6:51pm UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411/1 "2017-09-05T18:51:55Z")

</div>

Keep getting an error when running the following playbook. Copied from gethub and watch youtube running the same w/o error.

---

<div class="post-metadata">

**Author:** ![Sieds\_Pallas](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Sieds\_Pallas](https://forum.ansible.com/u/Sieds_Pallas)\
**Post date:** [September 5, 2017, 7:24pm UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411/2 "2017-09-05T19:24:37Z")

</div>

I think the dash needs to align with the t of task

---

<div class="post-metadata">

**Author:** ![Kenny\_Barnes](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@Kenny\_Barnes](https://forum.ansible.com/u/Kenny_Barnes)\
**Post date:** [September 5, 2017, 8:26pm UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411/3 "2017-09-05T20:26:33Z")

</div>

Thanks but I moved like so and now get another error.

tasks:

- name: Pull WWPNs from UCS  
getucswwpns:  
host={{ inventory\_hostname }}  
ucs\_user=“config”  
ucs\_pass=“config”  
outputfile=output.txt  
logfile=log.txt

The offending line appears to be:

- name: Pull WWPNs from UCS  
getucswwpns:  
^ here

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [September 5, 2017, 8:41pm UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411/4 "2017-09-05T20:41:26Z")

</div>

Hi,

All your problems lies to some wrong indentation...

Please read :  
[http://docs.ansible.com/ansible/latest/YAMLSyntax.html](http://docs.ansible.com/ansible/latest/YAMLSyntax.html)  
and  
[http://docs.ansible.com/ansible/latest/playbooks\_roles.html#task-versus-play-includes](http://docs.ansible.com/ansible/latest/playbooks_roles.html#task-versus-play-includes)

in your last error, getucswwpns need to be aligned to name...

Regards,

JYL

---

<div class="post-metadata">

**Author:** ![Kenny\_Barnes](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@Kenny\_Barnes](https://forum.ansible.com/u/Kenny_Barnes)\
**Post date:** [September 7, 2017, 1:17am UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411/5 "2017-09-07T01:17:56Z")

</div>

I have moved the alignment every way possible it seams. Will continue to read…

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [September 7, 2017, 9:42am UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411/6 "2017-09-07T09:42:26Z")

</div>

There’s also a problem with “:” and “=” If you put arguments on multiple lines you need to use “:” and not “=”… (preferred way for readability) Documentation about it here : If you put arguments on the same line than your module you need to use “=” Regards, JYL

---

<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:** [September 7, 2017, 1:24pm UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411/7 "2017-09-07T13:24:28Z")

</div>

The problem is that you have not shown you complete error message, the part you have is not relevant at all.  
If you look at you output is also say something like "the error might be else in the file".

If you had provided the completa error message you probably would had a answer much sooner.  
But my guess is that your problem is the hosts: line, remove the parentheses and the text between.

---

<div class="post-metadata">

**Author:** ![Kenny\_Barnes](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@Kenny\_Barnes](https://forum.ansible.com/u/Kenny_Barnes)\
**Post date:** [September 7, 2017, 2:55pm UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411/8 "2017-09-07T14:55:04Z")

</div>

Not sure what you mean my removing the parentheses and text between. Doesn’t that equal blank??  
This is my complete yml file\>

---

<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:** [September 7, 2017, 3:42pm UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411/9 "2017-09-07T15:42:52Z")

</div>

> Not sure what you mean my removing the parentheses and text between.  
> Doesn't that equal blank??  
> This is my complete yml file\>  
> ---  
> - name: Get Existing UCS Information  
> &nbsp;&nbsp;hosts: ucs  
> &nbsp;&nbsp;connection: local  
> &nbsp;&nbsp;gather\_facts: no

In you initial mail you had this  
&nbsp;&nbsp;hosts: ucs (Runs on UCS group in the inv file)

So if you had this in you playbook it would fail and the reason for my  
comment.

> &nbsp;&nbsp;tasks:  
> &nbsp;&nbsp;&nbsp;&nbsp;- name: Pull WWPNs from UCS  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getucswwpns:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hosts= {{ inventory\_hostname }}  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ucs\_usercwcw="config"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ucs\_passcwcw="config"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;outputfilecw=output.txt  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;logfile=log.txt
> 
> This is the complete error msg.  
> ERROR! no action detected in task. This often indicates a misspelled module  
> name, or incorrect module path.

This is the essential error message, your module getucswwpns doesn't exist.  
getucswwpns is not part of Ansible so you would need to install it.

---

<div class="post-metadata">

**Author:** ![Kenny\_Barnes](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@Kenny\_Barnes](https://forum.ansible.com/u/Kenny_Barnes)\
**Post date:** [September 13, 2017, 6:41pm UTC](https://forum.ansible.com/t/newbie-question-on-syntax/25411/10 "2017-09-13T18:41:48Z")

</div>

I did not add the getucswwpns module, and good to know it has to be. Thanks for the input.
