Skip to content

Commit

Permalink
Fixes for issue #732 (#733)
Browse files Browse the repository at this point in the history
Co-authored-by: Gianluca Piana <gianluca.piana@nposervices.com>
  • Loading branch information
WoodooTek and Gianluca Piana committed Mar 15, 2022
1 parent 56f14e8 commit d0e5c87
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions plugins/inventory/azure_rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,11 @@ def hostvars(self):
av_zone = self._vm_model['zones']

new_hostvars = dict(
network_interface=[],
mac_address=[],
network_interface_id=[],
security_group_id=[],
security_group=[],
public_ipv4_addresses=[],
public_dns_hostnames=[],
private_ipv4_addresses=[],
Expand Down Expand Up @@ -564,12 +569,12 @@ def hostvars(self):
if pip_fqdn:
new_hostvars['public_dns_hostnames'].append(pip_fqdn)

new_hostvars['mac_address'] = nic._nic_model['properties'].get('macAddress')
new_hostvars['network_interface'] = nic._nic_model['name']
new_hostvars['network_interface_id'] = nic._nic_model['id']
new_hostvars['security_group_id'] = nic._nic_model['properties']['networkSecurityGroup']['id'] \
new_hostvars['mac_address'].append(nic._nic_model['properties'].get('macAddress'))
new_hostvars['network_interface'].append(nic._nic_model['name'])
new_hostvars['network_interface_id'].append(nic._nic_model['id'])
new_hostvars['security_group_id'].append(nic._nic_model['properties']['networkSecurityGroup']['id']) \
if nic._nic_model['properties'].get('networkSecurityGroup') else None
new_hostvars['security_group'] = parse_resource_id(new_hostvars['security_group_id'])['resource_name'] \
new_hostvars['security_group'].append(parse_resource_id(nic._nic_model['properties']['networkSecurityGroup']['id'])['resource_name']) \
if nic._nic_model['properties'].get('networkSecurityGroup') else None

# set image and os_disk
Expand Down

0 comments on commit d0e5c87

Please sign in to comment.