Hi, I struggle with some issue with variables definition which I am not totally understand and can't find help in ansible docs.
I am trying to have nice variables structure and save it as json file (re-use as local facts). So I have *groups_vars* file: g_core_vars: version : "0.1.0" varinfo: vi_name : "core_vars" vi_vartype : "groupvars-all" vars: status : "non-prod" env : "develop" lob : "none" product: "none" prole : "other" roles: - web Now I would like to create variable based on above values: For example: g_core_nagios_filename: '{{ g_core_vars.vars.env }}-{{ g_core_vars.vars.product }}'.cfg However I am gettig error on ansible: ERROR: One or more undefined variables: 'dict object' has no attribute: 'vars'. My goal is no that I can write this variabe 'g_core_vars' to json with 'copy' module: - name: Write g_core_vars variables to local facts copy: content="{{ g_core_vars }}" dest=/etc/ansible/facts.d/{{ g_core_vars .varinfo.vi_name }}.fact owner=root group=root mode=0644 *Summary:* - How I can use defined variables which used previous variables names and can be saved as json in one task? - Not quite undertand this principle that I have to define each variable sepearatly. # Variables files. var01: 'value01' var02: 'value02' somevars1: v01: '{{ var01 }}' v02: '{{ var02 }}' # Will work somevars2: '{{ var01 }}-{{ var02 }}' # Will not work somevars2: '{{ somevars1.var01 }}' Please advice. Best regards. Marcin -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1d3b58f6-aa1f-4bd2-8f65-38bbef00aac7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.