How to use variable declare in this variable

12 views
Skip to first unread message

COUSSI Matthieu

unread,
Dec 5, 2018, 9:32:29 AM12/5/18
to Ansible Project
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
Reply all
Reply to author
Forward
0 new messages