Jan-19-2020, 12:17 PM
Hey,
im using python3 and i use ansible.
i get this ansible output :
i need python to extract the list after
im using python3 and i use ansible.
i get this ansible output :
"['', 'PLAY [localhost] **', '', 'TASK [Gathering Facts] **', 'ok: [localhost]', '', 'TASK [Create a VM folder on given datacenter] **', 'ok: [localhost]', '', 'TASK [debug] ***', 'ok: [localhost] => {', ' 'msg': [', ' 'temp11579079896506',', ' 'temp1157902013446',', ' temp11579018229876',', ' 'temp2323',', ' 'temp11578823964592'', ' ]', '}', '', 'PLAY RECAP ****', 'localst: ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ', '', '']"which is a string.
i need python to extract the list after
"'msg':"and for it to look like that :
['temp11579079896506', 'temp1157902013446','temp11579018229876', 'temp2323','temp11578823964592']I just cant understand regex i really tried on my own, thanks