Ansible Azure module returns the data in a weird format Double single quoted characters
.
''network_interface_names'': [''Ubuntu915'']
As a result I can't use this anywhere to filter other resources.
Any idea what can be done to fix this or make it json?
- name: Get facts by name
azure_rm_virtualmachine_info:
resource_group: "{{ resource_group }}"
name: "{{ vm_name }}"
register: azure_vm_info
- name: "Network interface List"
set_fact:
azure_vm_network_interface: "{{ [ azure_vm_info.vms[0].network_interface_names ] }}"
- name: Print Azure VM Info
debug:
msg: "Azure VM INFO: {{ azure_vm_info.vms[0].network_interface_names }}"
Output:
TASK [Print Azure VM Info] ****************************************************************************************************************************************************************************************************************************************************
ok: [localhost] =>
msg: 'Azure VM INFO: [''Ubuntu915'']'