Thanks alot dude. It did work ^^
i have recently got it working using lookup(‘file’, ‘/etc/foo.txt’) | from_json).get(‘fw2’).get(‘ipv4’).get(‘rtr’).get(‘ip’) # haha though it didn’t look quit pretty
i noticed if i am using an attribute with a minus sign i.e “fw2-m” the dot notation wouldn’t work.
Just curious how could one overcome this issue?
Python identifiers is not allowed to have dash in them(because dash is a subtraction), so only way around it in Ansible, is to use the square brackets notation.