# How to use variable declare in this variable

**URL:** <https://forum.ansible.com/t/how-to-use-variable-declare-in-this-variable/29200>\
**Category:** Ansible Project\
**Created:** [December 5, 2018, 2:32pm UTC](https://forum.ansible.com/t/how-to-use-variable-declare-in-this-variable/29200 "2018-12-05T14:32:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcoussi](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mcoussi/32/8056_2.png) [@mcoussi](https://forum.ansible.com/u/mcoussi)\
**Post date:** [December 5, 2018, 2:32pm UTC](https://forum.ansible.com/t/how-to-use-variable-declare-in-this-variable/29200/1 "2018-12-05T14:32:29Z")

</div>

Hi,

I try to declare a variable which contains all my structure.

But for the struct.parts, i use a variable which declare in another branch of my struct var (struct.hdds) and it doesn’t work …

`

# Valorisation des variables de structures

struct:  
hdds:  
{ disque: /dev/sdb, pv\_name: /dev/sdb1, size: 8GiB, vg\_name: vgdata }  
parts:

- { vg: “{{ **struct.hdds.vg\_name** }}”, lv\_name: lvsoft, fs: xfs, mount: /soft, size: 2000}
- { vg: “{{ **struct.hdds.vg\_name** }}”, lv\_name: lvappexe, fs: xfs, mount: /appexe, size: 2000}
- { vg: “{{ **struct.hdds.vg\_name** }}”, lv\_name: lvexploit, fs: xfs, mount: /exploit, size: 2000}
- { vg: “{{ **struct.hdds.vg\_name** }}”, lv\_name: lvfslog, fs: xfs, mount: /fslog, size: 2000}  
`

Is it possible?

Thx for your help,

Matt
