# Syntax for providing module parameters

**URL:** <https://forum.ansible.com/t/syntax-for-providing-module-parameters/17465>\
**Category:** Ansible Project\
**Created:** [February 7, 2015, 2:11pm UTC](https://forum.ansible.com/t/syntax-for-providing-module-parameters/17465 "2015-02-07T14:11:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_McMahon](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@Jim\_McMahon](https://forum.ansible.com/u/Jim_McMahon)\
**Post date:** [February 7, 2015, 2:11pm UTC](https://forum.ansible.com/t/syntax-for-providing-module-parameters/17465/1 "2015-02-07T14:11:15Z")

</div>

Many examples of tasks I see give module parameters with key=value syntax like this:

- name: add update-motd package  
sudo: yes  
yum:  
name=update-motd  
state=present  
tags:

- motd

- name: install figlet for banner messages with pizazz  
sudo: yes  
yum:  
name=figlet  
state=present  
tags:

- motd

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [February 7, 2015, 2:13pm UTC](https://forum.ansible.com/t/syntax-for-providing-module-parameters/17465/2 "2015-02-07T14:13:17Z")

</div>

​Personally, I prefer the second., which is more pure yamlish.

---

<div class="post-metadata">

**Author:** ![Jim\_McMahon](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@Jim\_McMahon](https://forum.ansible.com/u/Jim_McMahon)\
**Post date:** [February 7, 2015, 2:18pm UTC](https://forum.ansible.com/t/syntax-for-providing-module-parameters/17465/3 "2015-02-07T14:18:34Z")

</div>

This is good to know, thanks. I kind of discovered the second syntax when studying Yaml. But most of the examples I see on the Ansible pages use name=value, which made me wonder if the name: value style was not appropriate.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 7, 2015, 3:10pm UTC](https://forum.ansible.com/t/syntax-for-providing-module-parameters/17465/4 "2015-02-07T15:10:47Z")

</div>

Both syntaxes are valid, you see more of the key=value in the docs because it is more concise (1 line). When the module requires many arguments we tend to switch (check the cloud guides).

The truth is that the yaml syntax might be better as it avoids an extra parser.
