Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to fetch instance private ip address via inventory script #1768

Open
liad5h opened this issue Nov 24, 2024 · 2 comments · May be fixed by #1770
Open

Unable to fetch instance private ip address via inventory script #1768

liad5h opened this issue Nov 24, 2024 · 2 comments · May be fixed by #1770
Labels
has_pr PR fixes have been made inventory plugin/Inventory/azure_rm.py related issues medium_priority Medium priority

Comments

@liad5h
Copy link

liad5h commented Nov 24, 2024

SUMMARY

I am trying to create an inventory of all of my VMs in Azure using the dynamic inventory plugin.
When I do manage to get a successful run, I get a list of VMs without their private ip addresses.
It looks like all nic related information is missing.

Am I missing something?

ISSUE TYPE
  • Bug Report
COMPONENT NAME

inventory plugin

ANSIBLE VERSION
# ansible --version
ansible [core 2.15.13]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.10 (main, Sep  9 2024, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-2)] (/usr/bin/python3.11)
  jinja version = 3.1.4
  libyaml = True
COLLECTION VERSION
# ansible-galaxy collection list

# /usr/share/ansible/collections/ansible_collections
Collection              Version
----------------------- -------
amazon.aws              9.0.0
ansible.posix           1.6.2
ansible.windows         2.5.0
awx.awx                 24.6.1
azure.azcollection      3.0.0
community.vmware        5.1.0
google.cloud            1.4.1
kubernetes.core         5.0.0
kubevirt.core           2.1.0
openstack.cloud         2.2.0
ovirt.ovirt             3.2.0
redhatinsights.insights 1.3.0
theforeman.foreman      5.0.0
vmware.vmware           1.6.0
CONFIGURATION
# ansible-config dump --only-changed
CONFIG_FILE() = None
OS / ENVIRONMENT

I am running from a kubernetes pod on AWS EKS, using the awx-ee:latest image.
I configured credentials to Azure via the following environment variables:

AZURE_TENANT
AZURE_SUBSCRIPTION_ID
AZURE_CLIENT_ID
AZURE_SECRET
STEPS TO REPRODUCE
plugin: azure.azcollection.azure_rm
#plain_host_names: yes
azure_use_private_ip: yes
exclude_host_filters:
  - powerstate != 'running'
  - os_profile['system'] != 'linux'
hostvar_expressions:
  ansible_host: private_ipv4_addresses
include_vmss_resource_groups:
  - "*"

then run

ansible-inventory -i /tmp/azure_rm.yaml --list
EXPECTED RESULTS

nic related information should not be missing.

ACTUAL RESULTS
"network_interface": [],
"network_interface_id": [],
"mac_address": [],
"private_ipv4_addresses": []
@Fred-sun Fred-sun added medium_priority Medium priority work in In trying to solve, or in working with contributors labels Nov 26, 2024
@Fred-sun
Copy link
Collaborator

@liad5h Do you want to return a message like #1770?

@liad5h
Copy link
Author

liad5h commented Nov 26, 2024

@Fred-sun as long as it is possible to get the instance private ip address and other nic details, it works for me :)

@Fred-sun Fred-sun added has_pr PR fixes have been made inventory plugin/Inventory/azure_rm.py related issues and removed work in In trying to solve, or in working with contributors labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has_pr PR fixes have been made inventory plugin/Inventory/azure_rm.py related issues medium_priority Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants