# Simplify naming conventions: use item key instead of pkg/src/uri/etc

**URL:** <https://forum.ansible.com/t/simplify-naming-conventions-use-item-key-instead-of-pkg-src-uri-etc/13002>\
**Category:** Ansible Project\
**Created:** [June 21, 2013, 4:32am UTC](https://forum.ansible.com/t/simplify-naming-conventions-use-item-key-instead-of-pkg-src-uri-etc/13002 "2013-06-21T04:32:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Berend\_de\_Boer](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@Berend\_de\_Boer](https://forum.ansible.com/u/Berend_de_Boer)\
**Post date:** [June 21, 2013, 4:32am UTC](https://forum.ansible.com/t/simplify-naming-conventions-use-item-key-instead-of-pkg-src-uri-etc/13002/1 "2013-06-21T04:32:22Z")

</div>

Hi All,

I’ve noticed that ansible is slightly harder to use than it can be: every command has its own idea of what the name of the main parameter is. i.e. “pkg”, “src”, “uri”.

May I suggest this gets all changed to item? One less thing to look up and remember.

All the best,

Berend.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [June 22, 2013, 5:01pm UTC](https://forum.ansible.com/t/simplify-naming-conventions-use-item-key-instead-of-pkg-src-uri-etc/13002/2 "2013-06-22T17:01:23Z")

</div>

This is already pretty much done, everything responds to “name”, except for things that obviously have a src and destination, like the copy and template modules, where I think src/dest are still appropriate, or when the name isn’t really a name.

Now what we _should_ do is make sure the documentation consistently uses “name”.

I think “item” would be confusing given it’s use in “with\_items” and so forth.

–Michael

---

<div class="post-metadata">

**Author:** ![martin\_f\_krafft](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@martin\_f\_krafft](https://forum.ansible.com/u/martin_f_krafft)\
**Post date:** [June 22, 2013, 5:46pm UTC](https://forum.ansible.com/t/simplify-naming-conventions-use-item-key-instead-of-pkg-src-uri-etc/13002/3 "2013-06-22T17:46:04Z")

</div>

also sprach Michael DeHaan \<michael.dehaan@gmail.com\> [2013.06.22.1901 +0200]:

> This is already pretty much done, everything responds to "name",  
> except for things that obviously have a src and destination, like  
> the copy and template modules, where I think src/dest are still  
> appropriate, or when the name isn't really a name.

apt still takes 'pkg', lvg wants 'vg', lvol wants 'lv', apt\_key has  
'id', apt\_repository has 'repo', …

What is the process of changing all those? How does Ansible  
deprecate stuff in user configs?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [June 24, 2013, 2:02am UTC](https://forum.ansible.com/t/simplify-naming-conventions-use-item-key-instead-of-pkg-src-uri-etc/13002/4 "2013-06-24T02:02:47Z")

</div>

in the modules, aliases can be used to rename to ‘name’ while keeping the old pkg, etc.

---

<div class="post-metadata">

**Author:** ![Berend\_de\_Boer](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@Berend\_de\_Boer](https://forum.ansible.com/u/Berend_de_Boer)\
**Post date:** [June 24, 2013, 2:27am UTC](https://forum.ansible.com/t/simplify-naming-conventions-use-item-key-instead-of-pkg-src-uri-etc/13002/5 "2013-06-24T02:27:14Z")

</div>

Great! Switching my stuff now.

One more: what about the true/false or on/off? I think we could just settle for one thing here as well. Just use true/false.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 24, 2013, 2:08pm UTC](https://forum.ansible.com/t/simplify-naming-conventions-use-item-key-instead-of-pkg-src-uri-etc/13002/6 "2013-06-24T14:08:09Z")

</div>

Modules “booleanify” things for the most part, so yes/no gets converted internally to true and false, so generally we’ve just been using yes/no everywhere. There is one or two examples (I believe zfs) where the module needs to be updated to enable that.

---

<div class="post-metadata">

**Author:** ![Berend\_de\_Boer](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@Berend\_de\_Boer](https://forum.ansible.com/u/Berend_de_Boer)\
**Post date:** [June 25, 2013, 6:40am UTC](https://forum.ansible.com/t/simplify-naming-conventions-use-item-key-instead-of-pkg-src-uri-etc/13002/7 "2013-06-25T06:40:00Z")

</div>

That’s exactly the example I had in mind 🙂

Was writing zfs tasks and noticed it used on/off.

Thanks a lot,

Berend.
