# Convert from short syntax to YAML syntax automatically

**URL:** <https://forum.ansible.com/t/convert-from-short-syntax-to-yaml-syntax-automatically/36688>\
**Category:** Ansible Project\
**Created:** [June 3, 2022, 4:01pm UTC](https://forum.ansible.com/t/convert-from-short-syntax-to-yaml-syntax-automatically/36688 "2022-06-03T16:01:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gtirloni](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gtirloni/32/4562_2.png) [@gtirloni](https://forum.ansible.com/u/gtirloni)\
**Post date:** [June 3, 2022, 4:01pm UTC](https://forum.ansible.com/t/convert-from-short-syntax-to-yaml-syntax-automatically/36688/1 "2022-06-03T16:01:06Z")

</div>

Hello,

I inherited a huge codebase that used Ansible's short syntax for a  
long time and then transitioned to the YAML syntax.

Is there any tool out there that would convert to YAML syntax  
automatically? My searches were not very fruitful.

Thanks,  
Giovanni

---

<div class="post-metadata">

**Author:** ![Andrew\_Latham](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@Andrew\_Latham](https://forum.ansible.com/u/Andrew_Latham)\
**Post date:** [June 3, 2022, 6:17pm UTC](https://forum.ansible.com/t/convert-from-short-syntax-to-yaml-syntax-automatically/36688/2 "2022-06-03T18:17:29Z")

</div>

Assuming you mean inventory you can use -y or --yaml via [https://docs.ansible.com/ansible/latest/cli/ansible-inventory.html](https://docs.ansible.com/ansible/latest/cli/ansible-inventory.html)

e.g. ansible-inventory --inventory input\_inentory --yaml --list

\*\* I did a search for `short syntax` and could not find what it means in this context so I guessed it meant INI format.

---

<div class="post-metadata">

**Author:** ![gtirloni](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gtirloni/32/4562_2.png) [@gtirloni](https://forum.ansible.com/u/gtirloni)\
**Post date:** [June 3, 2022, 6:38pm UTC](https://forum.ansible.com/t/convert-from-short-syntax-to-yaml-syntax-automatically/36688/3 "2022-06-03T18:38:39Z")

</div>

```auto
- name: OpenSSH daemon configuration
  become: yes
  template: src=sshd_config.j2 dest=/etc/ssh/sshd_config
  notify: reload-sshd

```

vs.

```auto
- name: OpenSSH daemon configuration
  become: yes
  template:
    src: sshd_config.j2
    dest: /etc/ssh/sshd_config
  notify: reload-sshd

```
