I have a list of objects with names like this: 'obj-0001', 'obj-0002' and 
need to set_stats with some data about these objects in the following 
structure:

"data": {
  "obj-0001": { "a": 1, "b": 2 },
  "obj-0002": { "a": 3, "b": 4 }
}

They then can be referenced as data['obj-0001'].a

set_stats:
  data:
    'obj_0001': 5        # this works
    'obj-0002': 6         # this does NOT work: the variable name 
'obj-0002' is not valid

As far as I understand, there is no limitation on character set in keys 
while they are accessed using quotes in brackets: data['obj-0002'].

Is there any way to make such assignment in ansible? I really do not want 
to restrict character sets in hash keys to alphanumeric only if possible.

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a5874989-0503-4d01-92c5-01d1860439a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to