# Is it possible to use YAML node references in role task?

**URL:** <https://forum.ansible.com/t/is-it-possible-to-use-yaml-node-references-in-role-task/21391>\
**Category:** Ansible Project\
**Created:** [May 10, 2016, 12:25pm UTC](https://forum.ansible.com/t/is-it-possible-to-use-yaml-node-references-in-role-task/21391 "2016-05-10T12:25:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Artem\_Kozlov](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Artem\_Kozlov](https://forum.ansible.com/u/Artem_Kozlov)\
**Post date:** [May 10, 2016, 12:25pm UTC](https://forum.ansible.com/t/is-it-possible-to-use-yaml-node-references-in-role-task/21391/1 "2016-05-10T12:25:08Z")

</div>

Should it be possible to use YAML references in roles task to reference node from vars or defaults file? (I’m using ansible 2.0)

E.g I have vars/main.yml:

`

docker\_defaults: &docker\_defaults  
name: “{{name}}”

`

And then want to use this reference in tasks/main.yml:

`

- docker: \*docker\_defaults  
`

If no is there a way to add non-task YAML node to tasks/main.yml so then I could reference it from the same file?
