Comments (3)
Maybe one way to do this, would be to allow adding inventory_hostname
to hostvar_expressions
:
azure/plugins/inventory/azure_rm.py
Line 328 in 4467d13
And do something like:
compose_inventory_hostname = constructable_config_compose.pop("inventory_hostname")
And pass that to get_hostname here:
azure/plugins/inventory/azure_rm.py
Line 333 in 4467d13
inventory_hostname = self._get_hostname(h, compose_inventory_hostname, strict=constructable_config_strict)
Then _get_hostname would change to something like this:
def _get_hostname(self, host, compose=None, strict=False):
if not compose:
return host.default_inventory_hostname
try:
return self._compose(compose, h.hostvars)
except Exception as e:
if strict:
raise AnsibleParserError("Could not generate inventory_hostname for host %s from hostvar_expressions.inventory_hostname: %s" % (host.default_inventory_hostname, to_native(e)))
return host.default_inventory_hostname
Any comments on doing it like this? Or would using something other than hostvar_expressions
be preferrable?
from azure.
Can a maintainer review this? I think this would solve a similar issue we are having where we want to be able to pull in hosts by ip address instead of the vm name.
from azure.
Can a maintainer review this? I think this would solve a similar issue we are having where we want to be able to pull in hosts by ip address instead of the vm name
This PR has been reviewed and will be merged soon. Thank you!
from azure.
Related Issues (20)
- issue with inventory module. List of Hosts being returned will be missing hosts at random HOT 1
- azure_rm_adgroup Present members is not idempotent and does not follow ansible best practices HOT 4
- azure.azcollection.azure_rm_adgroup module Should allow for setting the description of the group #1485 > Only a partial Fix. Will not update existing groups. HOT 1
- Triggering on-demand backup returns error HOT 2
- azure.azcollection.azure_rm_virtualmachinescalesetinstance_info and related modules incompatible with Flexible VM Scale Sets HOT 4
- Add UserAssigned Identities to the postgrsqlflexibleserver module
- The `network_profile.outbound_type` property of the `azure_rm_aks` module does not accept `managedNATGateway`/`userAssignedNATGateway` HOT 1
- Return detailed diff from the `azure_rm_aks` module HOT 1
- azure_rm_subscription_info does not function as documented or expectd HOT 10
- Upgrade from 1.19 to 2.x - "msg": "Find the key vault secret got exception, exception as The current credential is not configured to acquire tokens for tenant xxx. HOT 14
- azure_rm_accesstoken_info leads to TypeError: Session.request() got an unexpected keyword argument 'claims' HOT 4
- azure_rm_resource_info subscription_id passed as parameter is not overruling environment variable HOT 4
- Azure inventory traceback when NIC isn't fully provisioned
- azure_rm_adapplication_info add option "app_diff"
- IPv6 address parsed as IPv4 HOT 6
- Hi, @Fred-sun and @markstoel.
- Login via Federated Credentials for Managed Identities HOT 1
- azure_rm_adapplication is not idempotent HOT 3
- azure_rm_adgroup_info returns error if device is not member of group HOT 2
- Feature Request: azure_rm_virtualmachine powerstate as a single parameter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure.